ipull
Version:
The only file downloader you'll ever need. For node.js and the browser, CLI and library for fast and reliable file downloads.
17 lines (16 loc) • 682 B
TypeScript
/**
* Creates a debounced function that can be aborted using an AbortSignal.
* The function will execute after a specified wait time, but can also execute immediately
* if the maximum wait time is reached since the last call.
*
* @param func - The function to debounce.
* @param options - Options for the debounce behavior.
* @returns A debounced version of the provided function.
*/
type AbortableDebounceOptions = {
maxWait?: number;
wait?: number;
signal?: AbortSignal;
};
export declare function abortableDebounce<T extends (...args: any[]) => void>(func: T, { wait, maxWait, signal }: AbortableDebounceOptions): (...args: Parameters<T>) => void;
export {};