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
You are ignoring the return value of doOnDispose and thus you are not chaining anything onto shared or unshared. RxJava is a fluent library where you keep "dotting into" the result of one operation to apply another one. For example:
Hi,
using RxJava 2.1.10.
according to the documentation for .share() I expect the onDispose to be called on the shared observable once all subscribers dispose.
Is my expectation wrong?
Thanks in advance.
http://reactivex.io/documentation/operators/refcount.html
Sample:
Log:
RX TEST: Shared Subscription #1: 0
RX TEST: Shared Subscription #2: 0
RX TEST: Shared Subscription #1: 1
RX TEST: Shared Subscription #2: 1
RX TEST: Shared Subscription #1: 2
RX TEST: Shared Subscription #2: 2
RX TEST: Shared Subscription #1: 3
RX TEST: Shared Subscription #2: 3
RX TEST: Shared Subscription #1: 4
RX TEST: Shared Subscription #2: 4
RX TEST: Shared Subscription #1: 5
RX TEST: Shared Subscription #2: 5
RX TEST: doOnDispose Subscription 1
RX TEST: disposing Subscription 1
RX TEST: doOnDispose Subscription 2
RX TEST: disposing Subscription 2
The text was updated successfully, but these errors were encountered: