window method

Observable<Stream<T>> window (Stream window)

Creates an Observable where each item is a Stream containing the items from the source sequence.

This List is emitted every time window emits an event.

Example

new Observable.periodic(const Duration(milliseconds: 100), (i) => i)
  .window(new Stream.periodic(const Duration(milliseconds: 160), (i) => i))
  .asyncMap((stream) => stream.toList())
  .listen(print); // prints [0, 1] [2, 3] [4, 5] ...

Implementation

Observable<Stream<T>> window(Stream window) =>
    transform(WindowStreamTransformer((_) => window));