Added some tests

This commit is contained in:
Angelos Chalaris
2018-01-28 16:28:54 +02:00
parent ed38c84c95
commit b18411617a
19 changed files with 257 additions and 33 deletions

10
test/debounce/debounce.js Normal file
View File

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