These are chat archives for ReactiveX/RxJava

27th
Oct 2015
Rudi Grinberg
@rgrinberg
Oct 27 2015 21:03
I have an observable that’s a static instance variable in my application class on android
but i keep either “losing” subscriptions to it somehow or it just dies
is what i’m doing not supposed to work?
Dorus
@Dorus
Oct 27 2015 21:10
My gamble: You do not keep a reference to your Subscription and a over-eager GC collect it?
Rudi Grinberg
@rgrinberg
Oct 27 2015 21:13
@Dorus you’re right i don’t keep a reference in 1 subscription. But in other places in the code i control the lifetime explictly and they’re still lost. Let me add add a reference here see if it changes anything
@Dorus no effect. Subscription is still lost.
Dorus
@Dorus
Oct 27 2015 21:15
Bad gamble then
Rudi Grinberg
@rgrinberg
Oct 27 2015 21:15
If it helps, the static observable is created from a static PublishSubject
I tihnk i found my problem
Dorus
@Dorus
Oct 27 2015 21:20
i'm not sure how you create a observable from a PublishSubject
Oh good :)
Rudi Grinberg
@rgrinberg
Oct 27 2015 21:20
it was that i’m an idiot
.asObservable()
how do i do .distinct() but only for consecutive elements?
Dorus
@Dorus
Oct 27 2015 21:21
Naah, programing is always about feeling like a idiot once you figure out what was wrong.
distinctUntilChanged() ?
Rudi Grinberg
@rgrinberg
Oct 27 2015 21:22
thanks!