O'Reilly logo

Reactive Android Programming by Tadas Subonis

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Unwrapping Observables

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.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required