O'Reilly logo

Mastering Reactive JavaScript by Erich de Souza Oliveira

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

Using the zip() operator

This operator lets you merge the values of given observables. It will run a given function for each element of each observable of the same index. So if you have two observables and you zip them, it will run your given function for the first element of the first observable and the first element of the second observable. If more elements are available, it will run the function for the second element of the first observable, the second element of the second observable, and so on.

This operator is analogous to the zip() function of libraries such as underscore and lodash.

This operator has the following signature:

Rx.Observable.zip(observables,[reduceFunction]); 

It receives an arbitrary number of arguments, and 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