UNPKG

@studiometa/js-toolkit

Version:

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

16 lines (15 loc) • 288 B
function throttle(fn, delay = 16) { let lastCall = 0; return function throttled(...args) { const now = Date.now(); if (now - lastCall < delay) { return; } lastCall = now; return fn(...args); }; } export { throttle }; //# sourceMappingURL=throttle.js.map