UNPKG

@bigmi/client

Version:

Reactive primitives for Bitcoin apps.

23 lines (22 loc) 525 B
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); //#region src/utils/debounce.ts function debounce(fn, delay) { let timeoutId; const debounced = ((...args) => { if (timeoutId) clearTimeout(timeoutId); timeoutId = setTimeout(() => { fn(...args); timeoutId = void 0; }, delay); }); debounced.cancel = () => { if (timeoutId) { clearTimeout(timeoutId); timeoutId = void 0; } }; return debounced; } //#endregion exports.debounce = debounce; //# sourceMappingURL=debounce.js.map