reactive.how 2.0-alpha Menu

combineLatest vs merge

combineLatest

This is how ❚ combineLatest works with two (or more) input streams:

  • Whenever any input stream emits a value, it combines the latest values emitted by each input stream
  • As a result, it returns a new stream of combined events

merge

This is how ❚ merge works with two (or more) input streams:

  • It interleaves the events of multiple input streams
  • As a result, it returns a single stream of interleaved events

As you can see, merge doesn’t change the event values or the arrival times.

Next


scan

See also


zip vs combineLatest

💌 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