Zipping emissions – zip operator

The zip operator is quite interesting. Think of a situation where you're working with multiple Observable/Flowables and want to perform some kind of operation on each subsequent emission of each producer. The zip operator enables you to perform exactly that. It accumulates emissions of multiple producers to create a new emission via the specified function. So, let's look at a pictorial representation to delve deeper:

As the picture depicts, the zip operator accumulates emissions from multiple producers into a single emission. It also takes a function to apply on the emissions as the scan or reduce operator, ...

Get Reactive Programming in Kotlin now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.