Travis build: 1653 [cron]

This commit is contained in:
30secondsofcode
2018-02-12 20:21:04 +00:00
parent 7751aef777
commit 189719dbc3
7 changed files with 32 additions and 34 deletions

View File

@ -1,10 +1,8 @@
const debounce = (fn, wait = 0) => {
let inDebounce;
return function() {
const context = this,
args = arguments;
clearTimeout(inDebounce);
inDebounce = setTimeout(() => fn.apply(context, args), wait);
const debounce = (fn, ms = 0) => {
let timeoutId;
return function(...args) {
clearTimeout(timeoutId);
timeoutId = setTimeout(() => fn.apply(this, args), ms);
};
};
module.exports = debounce;