Angular

Using MergeMap in Angular

The Angular MergeMap maps each value from the source observable into an inner observable, subscribes to it, and then starts emitting the values from it replacing the original value. It creates a new inner observable for every value it receives from the Source. Unlike SwitchMap, MergeMap does not cancel any of its inner observables. It merges the values from all of its inner observables and emits the values back into the stream.

Using MergeMap in Angular Read More »

Using SwitchMap in Angular

The Angular SwitchMap maps each value from the source observable into an inner observable, subscribes to it, and then starts emitting the values from it. It creates a new inner observable for every value it receives from the Source. Whenever it creates a new inner observable it unsubscribes from all the previously created inner observables. Basically it switches to the newest observable discarding all other.

Using SwitchMap in Angular Read More »

Angular Map Operator: Usage and Examples

The Angular observable Map operator takes an observable source as input. It applies a project function to each of the values emitted by that observable and transforms it into a new value. It then returns a new observable with the transformed values. The Map operator is pretty simple to use and is the most common operator that we use in Angular. We use a Map with a Pipe, which allows us to run multiple operators. You can also use Pipe to run multiple Map functions. In this guide, we’re going to learn how to use the Map operator with examples.

Angular Map Operator: Usage and Examples Read More »

Scroll to Top