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

registerOnSharedPreferenceChangeListener not support #49

Closed
zaijie1213 opened this issue Sep 28, 2018 · 3 comments
Closed

registerOnSharedPreferenceChangeListener not support #49

zaijie1213 opened this issue Sep 28, 2018 · 3 comments

Comments

@zaijie1213
Copy link

The language of MMKV

e.g. Objective-C, Swift, Java, or Kotlin
java

The version of MMKV

e.g. v1.0.10

v1.0.10

The platform of MMKV

e.g. iOS or Android

Android

The installation of MMKV

e.g. Cocoapods, Carthage, Maven, AAR Package or Git clone

What's the issue?

Post the outputs or screenshots for errors.
registerOnSharedPreferenceChangeListener And unregisterOnSharedPreferenceChangeListener
not suport
Explain what you want by example or code in English.

OnSharedPreferenceChangeListener Is a very common and important API

@lingol
Copy link
Collaborator

lingol commented Sep 28, 2018

Data-change-listener is not supported by design.
We suggest using something like event-bus to notify any interesting clients. Doing this inside a storage framework smells really bad.

@kadaluarsa
Copy link

Data-change-listener is not supported by design.
We suggest using something like event-bus to notify any interesting clients. Doing this inside a storage framework smells really bad.

how to use with eventbus when we don't have any callback from the value changes?

@lingol
Copy link
Collaborator

lingol commented Feb 5, 2021

Data-change-listener is not supported by design.
We suggest using something like event-bus to notify any interesting clients. Doing this inside a storage framework smells really bad.

how to use with eventbus when we don't have any callback from the value changes?

Whoever makes the change should notify any interesting partners, if any changes on that specific key are meant to be heard.
MMKV, as a fundament KV storage framework, chooses not to take that responsibilty.

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

3 participants