June 2017
Intermediate to advanced
400 pages
8h 44m
English
The Observable.concat() factory is the concatenation equivalent to Observable.merge(). It will combine the emissions 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.Observable;public class Launcher { public static void main(String[] args) { Observable<String> source1 = Observable.just("Alpha", "Beta", "Gamma", "Delta", "Epsilon"); Observable<String> source2 = Observable.just("Zeta", "Eta", "Theta"); Observable.concat(source1 ...
Read now
Unlock full access