bufferCount method

Observable<List<CommandResult<TResult>>> bufferCount (int count, [ int skip ])

Creates an Observable where each item is a List containing the items from the source sequence, in batches of count.

If skip is provided, each group will start where the previous group ended minus the skip value.

Example

Observable.range(1, 4)
  .bufferCount(2)
  .listen(print); // prints [1, 2], [3, 4]

Example with skip

Observable.range(1, 4).bufferCount(2, 1)
  .listen(print); // prints [1, 2], [2, 3], [3, 4], [4]

Implementation

Observable<List<T>> bufferCount(int count, [int skip]) => transform(
    new BufferStreamTransformer<T>(onCount<T, List<T>>(count, skip)));