How do I test a debounce function using mocha in javascript?
const debounce = (func, delay) => {
let timout;
return function() {
const context = this, args = arguments;
clearTimeout(timout);
timout = setTimeout(() => {
func.apply(context, args);
}, delay);
};
};
Aucun commentaire:
Enregistrer un commentaire