git.iko.soy/rowtype-yoga/yoga-r3f
on main help sign in
37 lines 644 B history raw
1export const _new = function (val) {
2 return function () {
3 return { value: val };
4 };
5};
7export const newWithSelf = function (f) {
8 return function () {
9 var ref = { value: null };
10 ref.value = f(ref);
11 return ref;
12 };
13};
15export const read = function (ref) {
16 return function () {
17 return ref.value;
18 };
19};
21export const modifyImpl = function (f) {
22 return function (ref) {
23 return function () {
24 var t = f(ref.value);
25 ref.value = t.state;
26 return t.value;
27 };
28 };
29};
31export const write = function (val) {
32 return function (ref) {
33 return function () {
34 ref.value = val;
35 };
36 };
37};