This commit is contained in:
2021-11-21 11:18:28 +01:00
parent 7a358eb836
commit 230b10b2a3
9339 changed files with 892519 additions and 62 deletions

34
node_modules/just-debounce/index.js generated vendored Normal file
View File

@@ -0,0 +1,34 @@
module.exports = debounce;
function debounce(fn, delay, atStart, guarantee) {
var timeout;
var args;
var self;
return function debounced() {
self = this;
args = Array.prototype.slice.call(arguments);
if (timeout && (atStart || guarantee)) {
return;
} else if (!atStart) {
clear();
timeout = setTimeout(run, delay);
return timeout;
}
timeout = setTimeout(clear, delay);
fn.apply(self, args);
function run() {
clear();
fn.apply(self, args);
}
function clear() {
clearTimeout(timeout);
timeout = null;
}
};
}