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

Naming events #618

Open
BernardoBF4 opened this issue Jan 8, 2024 · 2 comments
Open

Naming events #618

BernardoBF4 opened this issue Jan 8, 2024 · 2 comments

Comments

@BernardoBF4
Copy link

BernardoBF4 commented Jan 8, 2024

It would be nice if we could name events to be used with the useMMKVListner, so that when we do something like this storage.set('user', JSON.stringify(user)), we could also pass a third parameter as the event name.

This is nice bacause it'd be easier to filter events on the listener hook, like a switch or ifs. In some cases, you don't want the function inside the hook to be called at every change in the storage, so you need some sort of varification for calling the function only when wanted; named events could ease that a lot.

@mrousavy
Copy link
Owner

I think this is something that can be built ontop of MMKV in JS side, so yea we could implement this. PRs are much appreciated.

Copy link

Guten Tag, Hans here.

Note

New features, bugfixes, updates and other improvements are all handled mostly by @mrousavy in his free time.
To support @mrousavy, please consider 💖 sponsoring him on GitHub 💖.
Sponsored issues will be prioritized.

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

2 participants