sample method

Observable<T> sample (Stream sampleStream)

Returns an Observable that, when the specified sample stream 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.

Example

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

Implementation

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