February 2020
Intermediate to advanced
412 pages
9h 36m
English
The sequenceEqual() operator checks whether two observables emit the same values in the same order. It returns a Single<Boolean> with true if the emitted sequences are the same pairwise.
In the following code snippet, we create and then compare observables that emit the same sequence or different (by order or by value) sequences:
import io.reactivex.rxjava3.core.Observable;public class Ch3_29 { public static void main(String[] args) { Observable<String> obs1 = Observable.just("One","Two","Three"); Observable<String> obs2 = Observable.just("One","Two","Three"); Observable<String> obs3 = Observable.just("Two","One","Three"); Observable<String> obs4 = Observable.just("One","Two"); Observable.sequenceEqual(obs1, obs2) .subscribe(s ...
Read now
Unlock full access