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

FlatMap

The .flatMap() case is a bit more complex:

The operator here says that each received item is replaced by two new items that will be diamond shaped. After the two items are emitted, the sequence terminates normally (the vertical dash sign).

As we can see in the preceding figure, in the resulting Observable, each of the items was replaced by two elements. However, it emphasizes that the order of the items can be changed, because there is a green item after a blue one.

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