function-performer
Version:
Performer providing API for debounce, throttle, deduplication and limiting functions
13 lines (12 loc) • 587 B
TypeScript
import { IExecutable } from './executable';
type DeduplicatedFunction = (count: number, ...args: any[]) => any;
type DeduplicatedFunctionConfig = {
interval?: number;
};
declare class Deduplicate implements IExecutable {
private readonly _calls;
private readonly _interval;
constructor(config?: DeduplicatedFunctionConfig);
execute<TFunc extends DeduplicatedFunction>(config: DeduplicatedFunctionConfig | null, func: TFunc, ...args: Parameters<TFunc>): Promise<ReturnType<TFunc>>;
}
export { Deduplicate, type DeduplicatedFunction, type DeduplicatedFunctionConfig };