📅  最后修改于: 2022-03-11 14:47:44.058000             🧑  作者: Mango
/**
* @param {Function} func
* @param {number} wait
*/
function debounce(func, wait) {
let timeout = null;
return function(...args) {
clearTimeout(timeout);
timeout = setTimeout(() => {
func.apply(this, args)
}, wait)
}
}