combineLatest

accepts 2+ input streams, a project function (optional)

  • Whenever any input stream emits a value, it combines the latest values emitted by each input stream

returns a new stream of combined values

zip

accepts 2+ input streams, a project function (optional)

  • It waits for all input streams to have all emitted their n-th value
  • As soon as this condition is met, it combines all those n-th values and emits the n-th combined value

returns a new stream of combined values

Published on Monday, 6 Nov. 2017
Revised on Monday, 8 Oct. 2018

zip vs combineLatest in RxJS

As you can see, ❚ zip produces the first combined value only when both input streams have all emitted their first value.

While ❚ combineLatest combines values whenever any input stream emits a value, ❚ zip only combines each n-th values together.

See also


Compare all combining operators - The Illustrated Book of RxJS (40% off on Gumroad)


reduce vs scan

Cédric Soulas Follow Hire me

Freelance Developer Advocate. Motion graphics with code. JavaScript and Elm. cedricsoulas.com

Subscribe to reactive.how newsletter

Join the Newsletter

Learn Reactive Programming and stay up-to-date:

Receive my latest news, product updates and programming visualizations. You can unsubscribe at any time.

Highlights

@CedricSoulas

Making an illustrated book!

The Illustrated Book of RxJS

Learn more →