As we have already seen, there is often a need to create and consume nested Observables. Let's say that the User ID is produced by an Observable, and we have to use that ID to retrieve payments through another Observable.
Plugging everything in to one seamless flow might not be so straightforward and, in cases like these, we have often used tools like .flatMap(). In this section, we will see how to use .flatMap() in detail and how it works.
However, before that, we will first cover .flatMap() close brother .map(). It will later help us understand why it is necessary to use .flatMap() and how it is related to mapping.