@razorpay/blade
Version:
The Design System that powers Razorpay
22 lines (20 loc) • 598 B
JavaScript
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/explicit-function-return-type */
function debounce(func, wait) {
var timeoutId;
function wrapper() {
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
if (timeoutId) {
clearTimeout(timeoutId);
}
timeoutId = setTimeout(function () {
func.apply(void 0, args);
timeoutId = null;
}, wait);
}
return wrapper;
}
export { debounce as default };
//# sourceMappingURL=debounce.js.map