Class DebounceOperator
The debounce operator.
public static class DebounceOperator
- Inheritance
-
System.ObjectDebounceOperator
Methods
Debounce<T, TDuration>(Observable<T>, Func<T, Observable<TDuration>>)
Like DebounceTime<T>(Observable<T>, TimeSpan, IScheduler?), but the "quiet period" is a per-value inner
"duration" observable (durationSelector) instead of a fixed TimeSpan.
Every new source value cancels whatever duration observable is still pending for the previous value and
subscribes a fresh one; the pending value is emitted as soon as that duration observable emits its first
value or completes (an already-scalar/empty/synchronous duration selector therefore lets the value straight
through). Mirrors rxjs's debounce.
public static Observable<T> Debounce<T, TDuration>(this Observable<T> source, Func<T, Observable<TDuration>> durationSelector)
Parameters
sourceObservable<T>The source observable.
durationSelectorFunc<T, Observable<TDuration>>Given the most recent value, returns the observable whose first emission or completion lets it through.
Returns
- Observable<T>
An observable that emits the most recent value once the quiet period elapses.
Type Parameters
TThe element type of the source.
TDurationThe (unused) element type of the duration observable.