async/stream_debounce_utils library
Debounce a stream: emit an item only after a quiet gap. Roadmap #185.
Where debounceCallback (see debounce_utils.dart) wraps a function, this
wraps a Stream — the classic use is a search-box value stream where you
want to fire the query only once the user pauses typing, not on every
keystroke. Only the LATEST value in a burst survives; earlier values in the
same window are dropped.
Extensions
-
StreamDebounceExtensions
on Stream<
T> -
Chainable debounce variants on any Stream, so reactive pipelines read as
stream.debounce(d).map(...)instead of wrapping with the free function.
Functions
-
debounceStream<
T> (Stream< T> source, Duration duration) → Stream<T> -
Returns a stream that re-emits values from
source, but suppresses any value that is followed by another withinduration. Each value resets the timer; the value is forwarded only oncedurationelapses with no newer value.