UNPKG

function-performer

Version:

Performer providing API for debounce, throttle, deduplication and limiting functions

13 lines (12 loc) 545 B
import { IExecutable } from './executable'; type DebouncedFunction = (...args: any[]) => any; type DebouncedFunctionConfig = { interval?: number; }; declare class Debounce implements IExecutable { private readonly _calls; private readonly _interval; constructor(config?: DebouncedFunctionConfig); execute<TFunc extends DebouncedFunction>(config: DebouncedFunctionConfig | null, func: TFunc, ...args: Parameters<TFunc>): Promise<ReturnType<TFunc>>; } export { Debounce, type DebouncedFunction, type DebouncedFunctionConfig };