-
Notifications
You must be signed in to change notification settings - Fork 132
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
Bulk Set/Observe #46
Comments
Not at present. A quick way to work around this is to debounce the notifications by, say, On Wed, Jun 8, 2016 at 12:06 PM Martin Perebner [email protected]
|
If you can guarantee they are always set together you can use Otherwise you could consider storing them as one object or String, perhaps as JSON. |
Thanks for the suggestion, but I can't use zip, since if one of the fields is overwritten with the same value, it won't emit an item, and thus zip won't work. |
TL;DR: rx-preferences drops atomicity of multi-preference commits. If I need atomicity I'd want access to the wrapped SharedPreferences object to use the standard Editor builder approach. However the object is not visible; I'd have to keep track of the original SharedPreferences object separately. For the time being I am forking the project to give me the customizations that I need - I find rx-preferences very useful otherwise. Sadly I doubt that my changes (besides the trivial object visibility change) would be acceptable to this project, as they are not very "reactive". |
If they really belog together, just create a model class that holds these 3 values and store that. |
@PaulWoitaschek Using a model sounds like a good solution, but you that introduces different kinds of problems. For storing models into |
Is it possible to bulk set/observe several values?
For example I have one string and two enums, which I set at the same time.
Currently this causes as to be expected three emissions (I use combineLatest) .
Is there a way to delay the
apply
so all three values are set together, and observe this set as a whole, while still using different datatypes?The text was updated successfully, but these errors were encountered: