1 const debounce = (func, wait, immediate) => {
9 if (!immediate) func.apply(context, args);
12 const callNow = immediate && !timeout;
14 clearTimeout(timeout);
16 timeout = setTimeout(later, wait);
18 if (callNow) func.apply(context, args);
22 export default debounce;