How do you make a function that only calls input function f every 50 milliseconds?
Anonimo
Actually whats being asked is Debounce. Its a pretty common concept for Frontend function debounce(func, time) { let timeout; return () => { const args = arguments; const invokeLater = () => { timeout = null; func.apply(null, args); }; clearTimeout(timeout); timeout = setTimeout[invokeLater, time); }; }