combineLatest2<A, B, T> method

Observable<T> combineLatest2<A, B, T>(
  1. Stream<A> streamA,
  2. Stream<B> streamB,
  3. T combiner(
    1. A a,
    2. B b

Merges the given Streams into one Observable sequence by using the combiner function whenever any of the observable sequences emits an item.

The Observable will not emit until all streams have emitted at least one item.

Interactive marble diagram


  new Observable.just(1),
  new Observable.fromIterable([0, 1, 2]),
  (a, b) => a + b)
.listen(print); //prints 1, 2, 3


static Observable<T> combineLatest2<A, B, T>(
        Stream<A> streamA, Stream<B> streamB, T combiner(A a, B b)) =>
    Observable<T>(CombineLatestStream.combine2(streamA, streamB, combiner));