Skip to content

Instantly share code, notes, and snippets.



  • Adelaide, South Australia
View GitHub Profile
AndrWeisR / RxJs Merge
Last active Sep 4, 2020
RxJs merge example - mergeMap, concatMap, switchMap
View RxJs Merge

Example that demonstrates the differences between mergeMap, concatMap and switchMap. Click the button to create an observable that emits 10 values in sequence, A0,A1,A2 etc.

  • mergeMap will merge multiple streams, so you get interleaved "A" values every time you click.
  • concatMap will only start emitting values after the previous sequence has completed.
  • switchMap will start emitting a new sequence after each click.

Code sandbox: