onCount<T, S> function

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

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 startBufferEvery is provided, each group will start where the previous group ended minus the startBufferEvery value.

Implementation

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