greg 4d1d2f8c52
Some checks failed
continuous-integration/drone Build is failing
maj
2023-06-11 20:17:11 +02:00

20 lines
335 B
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = debounce;
function debounce(fn, delay) {
let timeout;
return function (...args) {
if (timeout) {
clearTimeout(timeout);
}
timeout = setTimeout(() => {
timeout = null;
fn(...args);
}, delay);
};
}