Type Alias DebounceConstructor<TFn>

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

Options for debounce function

Type Parameters

  • TFn

Type declaration

  • OptionaldisregardExecutionTime?: 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