function debounce(fun, delay) { let i; return function (...args) { if (i) clearTimeout(i) setTimeout(() => { fun.apply(this, args) }, delay); } }
function debounce(fun, delay) { let i; return function (...args) { if (i) clearTimeout(i) setTimeout(() => { fun.apply(this, args) }, delay); } }