bufferTime method

Observable<List<T>> bufferTime (Duration duration)

Creates an Observable where each item is a List containing the items from the source sequence, sampled on a time frame with duration.

Example

new Observable.periodic(const Duration(milliseconds: 100), (int i) => i)
  .bufferTime(const Duration(milliseconds: 220))
  .listen(print); // prints [0, 1] [2, 3] [4, 5] ...

Implementation

Observable<List<T>> bufferTime(Duration duration) =>
    transform(new BufferStreamTransformer<T>(onTime(duration)));