onStream<T, S, O> function

Stream<S> Function(Stream<T> stream, OnDataTransform<T, S> , OnDataTransform<S, S> ) onStream <T, S, O>(Stream<O> onStream)

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

Each item is a sequence containing the items from the source sequence, sampled on onStream.

Implementation

Stream<S> Function(
  Stream<T> stream,
  OnDataTransform<T, S>,
  OnDataTransform<S, S>,
) onStream<T, S, O>(Stream<O> onStream) {
  return (
    Stream<T> stream,
    OnDataTransform<T, S> bufferHandler,
    OnDataTransform<S, S> scheduleHandler,
  ) {
    return new _OnStreamSampler<T, S, O>(
      stream,
      bufferHandler,
      scheduleHandler,
      onStream,
    );
  };
}