es-toolkit
Version:
A state-of-the-art, high-performance JavaScript utility library with a small bundle size and strong type annotations.
17 lines (12 loc) • 399 B
JavaScript
;
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const debounce = require('./debounce.js');
function throttle(func, throttleMs = 0, options = {}) {
const { leading = true, trailing = true } = options;
return debounce.debounce(func, throttleMs, {
leading,
maxWait: throttleMs,
trailing,
});
}
exports.throttle = throttle;