debounceTime method

Observable<T> debounceTime (Duration duration)

Transforms a Stream so that will only emit items from the source sequence whenever the time span defined by duration passes, without the source sequence emitting another item.

This time span start after the last debounced event was emitted.

debounceTime filters out items emitted by the source Observable that are rapidly followed by another emitted item.

Interactive marble diagram

Example

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

Implementation

Observable<T> debounceTime(Duration duration) => transform(
    DebounceStreamTransformer<T>((_) => TimerStream<bool>(true, duration)));