@studiometa/js-toolkit
Version:
A set of useful little bits of JavaScript to boost your project! 🚀
10 lines (9 loc) • 410 B
TypeScript
/**
* Simple throttling helper that limits a function to only run once every {delay}ms.
*
* @param {Function} fn The function to throttle
* @param {number} [delay] The delay in ms
* @return {Function} The throttled function.
* @link https://js-toolkit.studiometa.dev/utils/throttle.html
*/
export declare function throttle(fn: (...args: unknown[]) => void, delay?: number): (...args: unknown[]) => void;