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

支持数据监听吗? #28

Closed
yimigao opened this issue Sep 25, 2018 · 6 comments
Closed

支持数据监听吗? #28

yimigao opened this issue Sep 25, 2018 · 6 comments

Comments

@yimigao
Copy link

yimigao commented Sep 25, 2018

日常开发经常会遇到对存储数据变化监听,mmkv支持数据监听吗?

@ysbing
Copy link
Contributor

ysbing commented Sep 25, 2018

I suggest you can use ViewModule

@lingol
Copy link
Collaborator

lingol commented Sep 25, 2018

No. MMKV doesn't support data-change observer/listener by design.
As ysbing has suggested, you can use ViewModule or something else to trigger an event after you change the data.

@as11051105
Copy link

room+ViewModule

@mrfanr
Copy link

mrfanr commented Sep 27, 2018

😄 Isn't it ViewModel?

@lingol lingol closed this as completed Sep 27, 2018
@langzuxiaozi
Copy link

建议支持数据监听,安卓需要跨进程监听数据变化,我自己是用getContentResolver实现的跨进程 sp

@lingol
Copy link
Collaborator

lingol commented Nov 8, 2018

MMKV does not and will not support data-change observer/listener.
And this is by design.

You're very welcome to wrap one on top of MMKV, if such feature is so crucial to you.

@sven-brobonds sven-brobonds mentioned this issue Jul 21, 2020
@billdizl billdizl mentioned this issue Apr 28, 2022
Closed
This was referenced Oct 25, 2023
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

6 participants