concat()

At first look, the concat() operator looks like another merge() operator, but this is not entirely true. The difference is that a concat() waits for other streams to be completed first before emitting a stream from the next stream in order. How you arrange your stream in your call to concat() matters. The operator is used in the following way:

// combination/concat.js

let firstStream$ = Rx.Observable.of(1,2,3,4);
let secondStream$ = Rx.Observable.of(5,6,7,8);

let concatStream$ = Rx.Observable.concat(
firstStream$,
secondStream$
);

concatStream$.subscribe(data => console.log(data));
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset