Initial commit

This commit is contained in:
2021-03-14 11:09:02 +01:00
commit 21e364ee38
1046 changed files with 126647 additions and 0 deletions

35
node_modules/underscore/modules/debounce.js generated vendored Normal file
View File

@ -0,0 +1,35 @@
import restArguments from './restArguments.js';
import delay from './delay.js';
// When a sequence of calls of the returned function ends, the argument
// function is triggered. The end of a sequence is defined by the `wait`
// parameter. If `immediate` is passed, the argument function will be
// triggered at the beginning of the sequence instead of at the end.
export default function debounce(func, wait, immediate) {
var timeout, result;
var later = function(context, args) {
timeout = null;
if (args) result = func.apply(context, args);
};
var debounced = restArguments(function(args) {
if (timeout) clearTimeout(timeout);
if (immediate) {
var callNow = !timeout;
timeout = setTimeout(later, wait);
if (callNow) result = func.apply(this, args);
} else {
timeout = delay(later, wait, this, args);
}
return result;
});
debounced.cancel = function() {
clearTimeout(timeout);
timeout = null;
};
return debounced;
}