Defined in: debouncer.ts:7
Options for configuring a debounced function
• TFn extends AnyFunction
optional enabled: boolean | (debouncer) => boolean;
optional enabled: boolean | (debouncer) => boolean;
Defined in: debouncer.ts:13
Whether the debouncer is enabled. When disabled, maybeExecute will not trigger any executions. Can be a boolean or a function that returns a boolean. Defaults to true.
optional leading: boolean;
optional leading: boolean;
Defined in: debouncer.ts:19
Whether to execute on the leading edge of the timeout. The first call will execute immediately and the rest will wait the delay. Defaults to false.
optional onExecute: (debouncer) => void;
optional onExecute: (debouncer) => void;
Defined in: debouncer.ts:23
Callback function that is called after the function is executed
Debouncer<TFn>
void
optional trailing: boolean;
optional trailing: boolean;
Defined in: debouncer.ts:28
Whether to execute on the trailing edge of the timeout. Defaults to true.
wait: number | (debouncer) => number;
wait: number | (debouncer) => number;
Defined in: debouncer.ts:34
Delay in milliseconds before executing the function. Can be a number or a function that returns a number. Defaults to 0ms
Your weekly dose of JavaScript news. Delivered every Monday to over 100,000 devs, for free.