@johngw/stream
Version:
Reactive programming tools using the WHATWG Streams API.
20 lines (19 loc) • 570 B
TypeScript
import { DebounceBehavior } from '#transformers/debounce/Behavior';
import { DebounceState } from '#transformers/debounce/State';
/**
* Debouncing behavior to queue the leading event.
*
* @group Transformers
* @see {@link debounce:function}
* @example
* ```
* --a-b-c--T20-d--|
*
* debounce(20, new DebounceLeadingBehavior())
*
* --a----------d---
* ```
*/
export declare class DebounceLeadingBehavior<T> implements DebounceBehavior<T> {
preTimer(state: DebounceState, chunk: T, controller: TransformStreamDefaultController<T>): DebounceState | void;
}