combineLatestList<T> method

Observable<List<T>> combineLatestList <T>(Iterable<Stream<T>> streams)

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

Example

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

Implementation

static Observable<List<T>> combineLatestList<T>(
        Iterable<Stream<T>> streams) =>
    Observable<List<T>>(CombineLatestStream.list<T>(streams));