I would like to observe my BehaviourSubject
. In RxJava 1 I was calling asObservable(), which is now gone.
I found publish()
but it returns connectable, which I don't want to.
How to turn behavior subject into observable in RxJava 2?
I would like to observe my BehaviourSubject
. In RxJava 1 I was calling asObservable(), which is now gone.
I found publish()
but it returns connectable, which I don't want to.
How to turn behavior subject into observable in RxJava 2?
From the What's different in 2.0 page, from 1.x Observable to 2.x Flowable :
asObservable : renamed to hide(), hides all identities now
So it seems that the hide method is what you are looking for.
You're probably looking for Observable.hide()
Hides the identity of this Observable and its Disposable. Allows hiding extra features such as Subject's Observer methods or preventing certain identity-based optimizations (fusion).