sample method

Stream<T> sample(
  1. Stream sampleStream
)

Emits the most recently emitted item (if any) emitted by the source Stream since the previous emission from the sampleStream.

Example

Stream.fromIterable([1, 2, 3])
  .sample(TimerStream(1, Duration(seconds: 1)))
  .listen(print); // prints 3

Implementation

Stream<T> sample(Stream<dynamic> sampleStream) =>
    SampleStreamTransformer<T>((_) => sampleStream).bind(this);