You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With StateFlow now available and the .stateIn() operator coming soon, it would be nice to be able to delegate sharedpreferences to a MutableStateFlow so that we can also observe the preference changes.
Interfaces could expose var observablePref: StateFlow<T>
properties if the consumer is interested in change notifications in addition to the standard var pref: T
and creating test doubles with these interfaces would just implement with a MutableStateFlow(default = T) builder.
I had started an implementation of this myself before I found that this library already does the first part.
Would you be willing to incorporate such a feature in this library?
Are PRs encouraged or is this something you would want to implement yourself?
The text was updated successfully, but these errors were encountered:
Hey there, thanks for reaching out!
I'm always all in for coroutines and it's features and contributions are highly appreciated.
So if you have an implementation ready, please don't hesitate to create PR.
With StateFlow now available and the .stateIn() operator coming soon, it would be nice to be able to delegate sharedpreferences to a MutableStateFlow so that we can also observe the preference changes.
Interfaces could expose
var observablePref: StateFlow<T>
properties if the consumer is interested in change notifications in addition to the standard
var pref: T
and creating test doubles with these interfaces would just implement with a MutableStateFlow(default = T) builder.
I had started an implementation of this myself before I found that this library already does the first part.
Would you be willing to incorporate such a feature in this library?
Are PRs encouraged or is this something you would want to implement yourself?
The text was updated successfully, but these errors were encountered: