@chayns-components/core
Version:
A set of beautiful React components for developing your own applications with chayns.
19 lines (17 loc) • 471 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.debounce = void 0;
const debounce = (func, waitFor) => {
let timeout;
return (...args) => new Promise(resolve => {
if (timeout) {
clearTimeout(timeout);
}
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
timeout = setTimeout(() => resolve(func(...args)), waitFor);
});
};
exports.debounce = debounce;
//# sourceMappingURL=debounce.js.map