Concat

Creates an output Observable which sequentially emits all values from given Observable and then moves on to the next.

You can think of concat like a line at an ATM, the next transaction (subscription) cannot start until the previous is completed.

Concatenates multiple Observables together by sequentially emitting their values, one Observable after the other.

const source1$ = of(1,2,3);
const source2$ = of(1,2,3);
const source3$ = of(1,2,3);

const result$ = concat(source1$, source2$, source3$);
result$.subscribe(
  val => console.log(val)
);

Last updated