Summary
In this chapter, we covered combining Observables in various useful ways. Merging is helpful in combining and simultaneously firing multiple Observables and combining their emissions into a single stream. The flatMap()
operator is especially critical to know, as dynamically merging Observables derived from emissions opens a lot of useful functionality in RxJava. Concatenation is similar to merging, but it fires off the source Observables sequentially rather than all at once. Combining with ambiguous allows us to select the first Observable
to emit and fire its emissions. Zipping allows you to combine emissions from multiple Observables, whereas combine latest combines the latest emissions from each source every time one of them fires. Finally, grouping allows you to split up an Observable
into several GroupedObservables
, each with emissions that have a common key.
Take time to explore combining Observables and experiment to see how they work. They are critical to unlock functionalities...