DEV Community

0 seconds of 7 minutes, 1 secondVolume 90%
Press shift question mark to access a list of keyboard shortcuts
00:00
00:00
07:01
 
Fabio Biondi
Fabio Biondi

Posted on

3 1

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:

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

Top comments (0)

SurveyJS custom survey software

JavaScript Form Builder UI Component

Generate dynamic JSON-driven forms directly in your JavaScript app (Angular, React, Vue.js, jQuery) with a fully customizable drag-and-drop form builder. Easily integrate with any backend system and retain full ownership over your data, with no user or form submission limits.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay