combineLatest<T, R> method

Observable<R> combineLatest <T, R>(Iterable<Stream<T>> streams, R combiner(List<T> values))

Merges the given Streams into one Observable sequence by using the combiner function whenever any of the observable sequences emits an item. This is helpful when you need to combine a dynamic number of Streams.

The Observable will not emit any lists of values until all of the source streams have emitted at least one value.

Interactive marble diagram

Example

Observable.combineLatest([ new Observable.just("a"), new Observable.fromIterable("b", "c", "d") ], (list) => list.join()) .listen(print); // prints "ab", "ac", "ad"

Implementation

static Observable<R> combineLatest<T, R>(
        Iterable<Stream<T>> streams, R combiner(List<T> values)) =>
    Observable<R>(CombineLatestStream<T, R>(streams, combiner));