...

/

Higher-Order Observables

Higher-Order Observables

Learn how to use higher-order observables in Angular, emphasizing the switchMap and mergeMap operators.

Observables that operate on other observables of observables are called higher-order observables. Higher-order observables have an inner observable that contains the actual values we are interested in using. We can use specific RxJS operators to flatten the inner observable and extract its values. The most used flattened operators in Angular development are the switchMap and mergeMap operators.

The switchMap operator

The switchMap operator takes an observable as a source and applies a given function to each item, returning an inner observable for ...