Skip to main content

debounceFrameObservablePipe

Alternative: debounceFrame$$$

Inlined: debounceFrameObservable, debounceFrame$$

Types

function debounceFrameObservablePipe<GValue>(): IObservablePipe<GValue, GValue>

Definition

Awaits for the next animation frame (createAnimationFrame) and emits the last value received from the source Observable.

Diagram

Example

Debounce frequent values

const source = createMulticastSource<number>();

const subscribe = pipe$$(source.subscribe, [
debounceFrame$$$(),
]);

subscribe((value: number) => {
console.log('value', value);
});

// emit some values
console.log('start');
source.emit(0);
source.emit(1);
source.emit(2);
console.log('end');

Output:

start
end
value: 2