Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

low: proposal api for using local, scoped and shared with value return #94

Closed
betula opened this issue Apr 29, 2021 · 1 comment
Closed

Comments

@betula
Copy link
Member

betula commented Apr 29, 2021

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();
@betula
Copy link
Member Author

betula commented Jun 7, 2021

useScopedValue, useSharedValue, useLocalValue - declined
Other implemented in 0.6.0

@betula betula closed this as completed Jun 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant