Interface DebounceConstructor<TFn>

Source
Expand description

Options to construct a debounce function

interface DebounceConstructor<TFn> {
    disregardExecutionTime?: boolean;
    fn: TFn;
    interval: number;
}

Properties§

§disregardExecutionTime?: boolean

By default, the debouncer takes in account the time the underlying function executes. i.e. the actual debounce interval is max(interval, executionTime). This default behavior guanrantees that no 2 calls will be executed concurrently.

If you want the debouncer to always debounce at the set interval, set this to true.

§fn: TFn

Function to be debounced

§interval: number

Minimum interval between each call

Setting this to <= 0 will make the debounce function a pure pass-through, not actually debouncing the function