UNPKG

@studiometa/js-toolkit

Version:

A set of useful little bits of JavaScript to boost your project! 🚀

11 lines (10 loc) • 517 B
/** * 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. * @returns {(...args:unknown[]) => void} The debounced function. */ export declare function debounce(fn: (...args: unknown[]) => void, delay?: number): (...args: unknown[]) => void;