UNPKG

@chayns-components/core

Version:

A set of beautiful React components for developing your own applications with chayns.

12 lines (11 loc) 342 B
export 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); }); }; //# sourceMappingURL=debounce.js.map