Closed betula closed 3 years ago
const factory = () => { const count = value(0); const inc = count.updater((value, [...args]) => value + 1); // proposal const dec = count.updater((value) => value - 1); return () => ({ count: count.get(), inc, dec }); } const Custom = () => { useScopedValue(factory).inc(); useSharedValue(factory).inc(); useLocalValue(factory).inc(); } t.to(k.updater((k_v, t_v, prev_t_v) => next_k_v)); // proposal updater using t.to(k); t.to.once(); t.to.sync();
useScopedValue, useSharedValue, useLocalValue - declined Other implemented in 0.6.0