Angular & RxJS Tips #2: Higher Order Observables - switchMap vs mergeMap vs concatMap vs exhaustMap

fabiobiondi

Fabio Biondi

Posted on July 5, 2022

Angular & RxJS Tips #2: Higher Order Observables - switchMap vs mergeMap vs concatMap vs exhaustMap

In this video I will talk about higher order observables, that are observables that emit other observables and especially I describe the differences between switchMap, mergeMap, concatMap and exhaustMap.

They can be really useful:
• nested http requests: we make a call to the server via httpClient, get the result and pass it to another http request
• we subscribe the valueChange of a reactive form and make a call to the server each time we type
• subscribe a Subject or a Store, acquire value, pass it on to another observable
• interceptors, guards and any other scenarios in which we need to create sequences of observables

Level: intermediate (you should already know Angular Fundamentals)


🔗 Follow me on:

💖 💪 🙅 🚩
fabiobiondi
Fabio Biondi

Posted on July 5, 2022

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related