🚨 Removing linter warnings

This commit is contained in:
Liyas Thomas
2020-01-24 17:50:30 +05:30
parent 92d8878c38
commit bbaa48c1ec
7 changed files with 22 additions and 27 deletions

View File

@@ -3,13 +3,13 @@
// functions which might be called frequently
// NOTE : Don't use lambda functions as this doesn't get bound properly in them, use the 'function (args) {}' format
const debounce = (func, delay) => {
let inDebounce
let inDebounce;
return function() {
const context = this
const args = arguments
clearTimeout(inDebounce)
inDebounce = setTimeout(() => func.apply(context, args), delay)
}
}
const context = this;
const args = arguments;
clearTimeout(inDebounce);
inDebounce = setTimeout(() => func.apply(context, args), delay);
};
};
export default debounce;