O'Reilly logo

RxJava Essentials by Ivan Morgillo

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

Chapter 5. Transforming Observables

In the previous chapter, we explored the filtering universe of RxJava. We learned how to filter the values we don't need with filter(), how to get subsets of the emitted values with take(), and how to get rid of duplicates with distinct(). We learned how to exploit time with timeout(), sample(), and debounce().

In this chapter, we will learn how to transform Observable sequences to create sequences that better fit our needs.

The *map family

RxJava provides a few mapping functions: map(), flatMap(), concatMap(), flatMapIterable(), and switchMap(). All these functions apply to an Observable sequence, transform its emitted values, and return them in a new form. Let's look at them one by one with proper real-world ...

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