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 · 0 comments
Open

Naming events #618

BernardoBF4 opened this issue Jan 8, 2024 · 0 comments

Comments

@BernardoBF4
Copy link

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 listner hook, like a switch of 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.

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