Demo: concat
The concat operator subscribes the provided list of observables one after the other and adds their output into a single output stream. Thus, the output of the observables gets concatinated back to back in order.
This is useful for the sequential execution of the observables(or tasks).
const input_1 = timer(500,1000).pipe(take(3));
const input_2 = interval(2000).pipe(take(3));
//concat subscribes input_2 only after input_1 is complete
//So, output of input_2 gets added only after that of input_1
const concatinatedOutput = concat(input_1 , input_2);
const output = concatinatedOutput.subscribe(v=>console.log(v))