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 that emits a List of the values emitted by the source Stream. 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


  Observable.fromIterable([0, 1, 2]),
.listen(print); // prints [1, 0], [1, 1], [1, 2]


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