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 zipIterable() operator

The zipIterable() operator works similarly to the zip() operator. The only difference is it lets you zip observables with JavaScript iterables objects such as arrays, sets, and maps.

This operator has the following signature:

observable.zipIterable(iterables,[reduceFunction]); 

It receives an arbitrary number of arguments, and the last is optional. In case of absence of the last parameter, it will only generate an array with the values:

  • iterables: This is any number of iterables to be zipped with the observable
  • reduceFunction: This is a function used to combine the elements in a single value; if this function is not provided, it will generate an array with the values

We can do a minor change in our first ...

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