-
Notifications
You must be signed in to change notification settings - Fork 246
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
Result.toObservable() which emits result on subscribe and on further updates. #11
Comments
It looks like from their example in StorIO emits a list of items back each time with the results. So it looks like you want the Result itself emitted back on subscribe and on subsequent changes? I think toObservable() would still be needed for other cases where you just need a sequence of the elements in the result but this looks like it could also be added. Thanks for the feedback. |
Yes, in my usecase I subscribe in the onCreate method of an activity to get my data and create my views according to the data. So I have to get my data once for initialization and then subsribe to it again to get further updates. To have all of this in 1 subscription would be awesome. Maybe I'm just spoiled from StorIO :D Again thanks for this awesome library :) |
Sure :) Do you think something like an overload of toSelfObservable(boolean emit), that if emit true emits right away would fit your use case? |
yes, thats good. |
Ok sounds simple enough! Will work on this for the next update |
It made sense to make this the default behavior so added in latest snapshot version. |
As far as i can see, Result has two toObservable-methods:
Enhancement:
It would be nice to have an Observable, which emits once on subscribe and emits on further updates (like in StorIO). With this, the first toObservable wouldn't be needed anymore, since we can simulate it with take(1) and flatmap. The second could be simulated by skip(1).
The text was updated successfully, but these errors were encountered: