SampleStreamTransformer<T> constructor

SampleStreamTransformer<T>(
  1. Stream<void> window(
    1. T event
    )
)

Constructs a StreamTransformer that, when the specified window emits an item or completes, emits the most recently emitted item (if any) emitted by the source Stream since the previous emission from the sample Stream.

Implementation

SampleStreamTransformer(Stream<void> Function(T event) window)
    : super(WindowStrategy.firstEventOnly, window,
          onWindowEnd: (queue) => queue.last);