Transformation Operators
Let's explore RxJS transformation operators with the help of interactive examples.
We'll cover the following...
We'll cover the following...
What are the transformation operators?
These operators help in transforming the source of an Observable.
mergeMap() operator
The mergeMap() operator allows us to take two source Observables and convert them into one source Observable. Why would this be useful? Well, if we have an application that retrieves data from two separate APIs, we can take the two API Observables and merge them into one single data source.
Example
Let’s have a look at how this works:
Here, we’re creating an Observable that returns the Getting Started With Angular title, and then we’re using the pipe() ...