// https://levelup.gitconnected.com/debounce-in-javascript-improve-your-applications-performance-5b01855e086 const debounce = (func, wait) => { let timeout; return function executedFunction(...args) { const later = () => { timeout = null; func(...args); }; clearTimeout(timeout); timeout = setTimeout(later, wait); }; }; export default debounce;