Closed seyedjafariy closed 6 years ago
Use firstOrError()
On Sun, Apr 29, 2018, 8:15 AM worldsnas notifications@github.com wrote:
Hi and thank you for your great effort on this library. there is only one thing I'd like to ask: when i use .asObservable() to get the result as a stream so I can transform it later in the chain (using concatMap or singleOrError or even toList) the chain won't work and .subscribe() won't get called. as far as I could understand the reason for this problem is that you are using OnSharedPreferenceChangeListener to get changes not the value therefore by not calling .complete() in the onCreate of your observable. we won't be able to transform the chain to any form of Single (since it needs the sourceObservable to call onComplete to carry on)
is there any way we can do the transformation without breaking the chain?
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/f2prateek/rx-preferences/issues/117, or mute the thread https://github.com/notifications/unsubscribe-auth/AAEEEZ57pMbJlpetaq-co82ob3uMHxtvks5tta7FgaJpZM4Trxyy .
oh, that was easy. thank you so much. save the day
Hi and thank you for your great effort on this library. there is only one thing I'd like to ask: when i use
.asObservable()
to get the result as a stream so I can transform it later in the chain (usingconcatMap
orsingleOrError
or eventoList
) the chain won't work and.subscribe()
won't get called. as far as I could understand the reason for this problem is that you are usingOnSharedPreferenceChangeListener
to get changes not the value therefore by not calling.complete()
in theonCreate
of your observable. we won't be able to transform the chain to any form ofSingle
(since it needs the sourceObservable to call onComplete to carry on)is there any way we can do the transformation without breaking the chain?