Files
FHC-Core/public/js/helpers/DebounceHelper.js
T

7 lines
187 B
JavaScript

export const debounce = (callback, wait) => {
let timeoutId = null;
return (context) => {
window.clearTimeout(timeoutId);
timeoutId = window.setTimeout(() => callback(), wait);
}
}