@kiwicom/orbit-components
Version:
Orbit-components is a React component library which provides developers with the easiest possible way of building Kiwi.com’s products.
16 lines (14 loc) • 402 B
JavaScript
var debounce = function debounce(callback, time) {
var interval;
return function () {
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
clearTimeout(interval);
interval = setTimeout(function () {
interval = null;
callback.apply(void 0, args);
}, time);
};
};
export default debounce;