Table of Contents

Class DebounceOperator

Namespace
RxSharp.Operators
Assembly
RxSharp.dll

The debounce operator.

public static class DebounceOperator
Inheritance
System.Object
DebounceOperator

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

source Observable<T>

The source observable.

durationSelector Func<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

T

The element type of the source.

TDuration

The (unused) element type of the duration observable.