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

16 lines
327 B
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = throttle;
function throttle(fn, delay) {
let lastCalled;
return function (...args) {
if (lastCalled == null || lastCalled + delay <= Date.now()) {
fn.call(this, ...args);
lastCalled = Date.now();
}
};
}