SampleStreamTransformer<T> constructor

SampleStreamTransformer<T>(Stream window(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.


SampleStreamTransformer(Stream window(T event))
    : super(WindowStrategy.firstEventOnly, window,
          onWindowEnd: (Iterable<T> queue) => queue.last) {
  assert(window != null, 'window stream factory cannot be null');