https://kotlinlang.org logo
Title
r

Rok Koncina

04/15/2019, 12:28 PM
I'm trying to create a continuous stream of items where I'd always get the last one (aka. cache) using the BehaviorSubject (or ReplySubject) but whenever the api call stream terminates, so does my main stream. How can I prevent that? One way would be linking them manually and ignoring the onComplete but then I loose the main feature of the Subject... Let me explain with an example. Here I only get the result the first time.
g

gsala

04/15/2019, 12:43 PM
r

Rok Koncina

04/15/2019, 2:01 PM
Thanks, I found this but it's for RxJava2, right? I'm (atm) working with RxJava1
g

gsala

04/15/2019, 2:03 PM
there was a version for RxJava1 too, probably not maintained anymore but here it is: https://github.com/JakeWharton/RxRelay/releases/tag/rxrelay-1.2.0 available through
implementation 'com.jakewharton.rxrelay:rxrelay:1.2.0'
r

Rok Koncina

04/15/2019, 2:07 PM
That might be it, I'll have a look, thanks
👍 1