onCount<T, S> function

Stream<S> Function(Stream<T> stream, OnDataTransform<T, S> , OnDataTransform<S, S> ) onCount <T, S>(int count, [ int skip ])

Higher order function implementation for _OnCountSampler which matches the method signature of buffer and window.

Each item is a sequence 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.

Implementation

Stream<S> Function(
  Stream<T> stream,
  OnDataTransform<T, S>,
  OnDataTransform<S, S>,
) onCount<T, S>(int count, [int skip]) {
  return (
    Stream<T> stream,
    OnDataTransform<T, S> bufferHandler,
    OnDataTransform<S, S> scheduleHandler,
  ) {
    return new _OnCountSampler<T, S>(
      stream,
      bufferHandler,
      scheduleHandler,
      count,
      skip,
    );
  };
}