reactive.how 2.0-alpha Menu

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. More generally, this is how ❚ zip operates with two (or more) input streams:

  • 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
  • As a result, it returns a new stream of combined events

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

See also


merge vs combineLatest


reduce vs scan

💌 I create something new each week!
Learn Reactive Programming and stay tuned.

Occasional updates, plus:

Cédric Soulas - Freelance Developer Advocate. Learn more.

Follow 👨‍💻 Hire me

News

@CedricSoulas