February 2020
Intermediate to advanced
412 pages
9h 36m
English
The isEmpty() operator checks whether an Observable is going to emit more items. It returns a Single<Boolean> with true if the Observable does not emit items anymore.
In the following code snippet, an Observable emits strings, and neither contain the letter z. The following filter, however, only allows a downstream flow of those items that do contain the letter z. This means that, after the filter, the Observable emits no items (becomes empty), but if the letter z is found in any of the emitted strings, the received result changes to false, as demonstrated in the following example:
import io.reactivex.rxjava3.core.Observable;public class Ch3_27 { public static void main(String[] args) { Observable.just("One", "Two", "Three") .filter(s ...
Read now
Unlock full access