UNPKG

vuestic-ui

Version:
20 lines (19 loc) 399 B
const debounce = (func, wait) => { let timeout = null; const fn = function(...args) { timeout && clearTimeout(timeout); timeout = setTimeout(() => { timeout = null; func.apply(this, args); }, wait); }; fn.cancel = () => { timeout && clearTimeout(timeout); timeout = null; }; return fn; }; export { debounce as d }; //# sourceMappingURL=debounce.mjs.map