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

Emulate nanostores listen vs subscribe #23

Open
cefn opened this issue Apr 25, 2023 · 0 comments
Open

Emulate nanostores listen vs subscribe #23

cefn opened this issue Apr 25, 2023 · 0 comments
Labels
store-react Related to @watchable/store-react

Comments

@cefn
Copy link
Owner

cefn commented Apr 25, 2023

I just found nanostores which has a lot in common with our store implementation.

One improvement is the ability to trigger a callback at the same time as watching...

In nanostores const store.subscribe(cb) passes the current state to cb while const store.listen(cb) just watches.

In our store, this could be achieved in a minor version (backward compatible) with a second boolean argument to watch, although this prevents potentially multiple watchers being passed as an argument, which is an alternative signature.

@cefn cefn added the store-react Related to @watchable/store-react label Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
store-react Related to @watchable/store-react
Projects
None yet
Development

No branches or pull requests

1 participant