@studiometa/js-toolkit
Version:
A set of useful little bits of JavaScript to boost your project! 🚀
12 lines (11 loc) • 576 B
TypeScript
/**
* Returns a function, that, as long as it continues to be invoked,
* will not be triggered. The function will be called after it stops
* being called for N milliseconds.
*
* @param {(...args:unknown[]) => void} fn The function to call.
* @param {number} [delay=300] The delay in ms to wait before calling the function.
* @return {(...args:unknown[]) => void} The debounced function.
* @link https://js-toolkit.studiometa.dev/utils/debounce.html
*/
export declare function debounce(fn: (...args: unknown[]) => void, delay?: number): (...args: unknown[]) => void;