The most common operator to concatenate two sources of data (observables) is the concat() operator. This operator receives multiple observables as arguments and concatenates all observables from the left to right. It preserves the order of the elements in the observables and only propagates data from the next observable if the current one is already terminated.
This operator has the following signature:
It accepts any number of arguments, but they all must be observables:
- observable: It is any number of observables
The easiest possible example is to use it to combine two observables:
Rx.Observable .just(1) .concat(Rx.Observable.just(2)) .subscribe((k)=>console.log(k));