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

Passing values

There will be a lot of cases where .map() was used, but we need to return the original value along with the new value.

One case where this can happen is the user registration. We might want to retrieve a User object and when that is ready, we will get the Access Token. However, there might be a consumer somewhere downstream that needs the value of the Access Token and the user ID that was used to retrieve it.

In general, it is a common necessity to pass some information from the nth step to the n+2 step in the Observable flow, as in this figure:

We can see that we need a User object to retrieve an Access Token. However, the ...

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