Files
sashinexists/node_modules/dettle/dist/throttle.js
2024-12-07 13:18:31 +11:00

13 lines
299 B
JavaScript

/* IMPORT */
import debounce from './debounce.js';
/* MAIN */
const throttle = (fn, wait = 1, options) => {
return debounce(fn, wait, {
leading: options?.leading ?? true,
trailing: options?.trailing ?? true,
maxWait: wait
});
};
/* EXPORT */
export default throttle;