sample method

Observable<T> sample (Stream sampleStream)

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

Example

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

Implementation

Observable<T> sample(Stream<dynamic> sampleStream) =>
    transform(SampleStreamTransformer<T>((_) => sampleStream));