February 2020
Intermediate to advanced
412 pages
9h 36m
English
The Observable.concat() factory is the concatenation equivalent to Observable.merge(). It will combine the emitted values of multiple observables, but will fire each one sequentially and only move to the next after onComplete() is called.
In the following code, we have two source observables emitting strings. We can use Observable.concat() to fire the emissions from the first one and then fire the emissions from the second one:
import io.reactivex.rxjava3.core.Observable;public class Ch4_09 { public static void main(String[] args) { Observable<String> src1 = Observable.just("Alpha", "Beta"); Observable<String> src2 = Observable.just("Zeta", "Eta"); Observable.concat(src1, src2) .subscribe(i ...
Read now
Unlock full access