February 2020
Intermediate to advanced
412 pages
9h 36m
English
Observable.defer() is a powerful factory due to its ability to create a separate state for each Observer. When using certain Observable factories, you may run into some nuances if your source is stateful and you want to create a separate state for each Observer. Your source Observable may not capture something that has changed regarding its parameters and send emissions that are obsolete. Here is a simple example: we have an Observable.range() built from two static int properties, start and count.
If you subscribe to this Observable, modify the count, and then subscribe again, you will find that the second Observer does not see this change:
import io.reactivex.rxjava3.core.Observable;public class Ch2_24 { private static ...
Read now
Unlock full access