utility
Topic
1 snippet found
1 snippet found
A utility function that limits how often a function can fire, useful for search input or resize events.
1function debounce(fn, delay = 300) {
2 let timeout;
3 return (...args) => {
4 clearTimeout(timeout...