Skip to content

@epikodelabs/streamix


@epikodelabs/streamix / debounce

Function: debounce()

debounce<T>(duration): Operator<T, T>

Defined in: projects/libraries/streamix/src/lib/operators/debounce.ts:15

Creates a stream operator that emits the most recent value from the source stream only after a specified duration has passed without another new value.

Values that are superseded before the timeout fires are forwarded to the output with dropped: true so that backpressure is released without surfacing them as real emissions.

Type Parameters

T

T = any

The type of the values in the source and output streams.

Parameters

duration

MaybePromise<number>

The debounce duration in milliseconds.

Returns

Operator<T, T>

An Operator instance for use in a stream pipeline.

Released under the GNU AGPL v3 or later.