Skip to main content

debounceImmediateObservablePipe

Alternative: debounceImmediate$$$

Inlined: debounceImmediateObservable, debounceImmediate$$

Types

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

Definition

Awaits for the next event loop (setImmediate) and emits the last value received from the source Observable.

Diagram

Example

Debounce frequent values

const source = createMulticastSource<number>();

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

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