Closed Yubyf closed 2 years ago
Implementation looks good, although I'm unclear how you will actually use this. DataStore doesn't seem to implement the SharedPreferences interface as far as I can tell (unless you plan to write some kind of DataStore -> SharedPreferences adapter?)
Implementation looks good, although I'm unclear how you will actually use this. DataStore doesn't seem to implement the SharedPreferences interface as far as I can tell (unless you plan to write some kind of DataStore -> SharedPreferences adapter?)
Yes, some time ago when I migrated SharedPreferences to DataStore, I found that I still needed to adapt the interface of SharedPreferences in some places (like RemotePreferences).
Therefore, I wrote a simple implementation here.
Since this library is not elegant enough and needs to use Kotlin Coroutine, I did not commit it here.
I see, makes sense! This might also be useful if someone ever wants to chain multiple RemotePreference instances together, I guess. I just have some minor nits regarding naming and docs, otherwise this LGTM.
To provide a custom implementation interface for SharedPreferences(like DataStore).