-
-
Notifications
You must be signed in to change notification settings - Fork 109
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
RxRiddle 1xx #14
Comments
Theoretically you can subscribe to the returned Observable much more often. There's also autoRef() which could be used. Maybe we can have a riddle for |
I'm closing this issue due to inactivity. If you have any further input on the issue, don't hesitate to reopen this issue or post a new one. |
I understand the intent here... but typically what I do in these cases is I coldly
That way the |
Sometimes it comes to a case when we need to have cold observable which shares its emissions between multiple observers. For example, presentation layer calls for data and we want to store it in repository at the same call. I use
publish().autoConnect(N)
in that cases (N - number of observers). Here is an example of such usage:This approach seems to have side-effects(storing data to maps in this case), however we can't (or maybe just I can't) have code 100% free of side-effects, unfortunately. But the point is that all 3 observers use the same emissions without making source produce them 3 times.
Used literature: Thomas Nield, Learning RxJava '2017: Chapter 5 - Automatic connection
The text was updated successfully, but these errors were encountered: