A tiny helper I reuse in almost every project. It waits until the user stops typing before running a search:
```js
const debounce = (fn, ms = 300) => {
let t;
return (...args) => {
clearTimeout(t);
t = setTimeout(() => fn(...args), ms);
};
};
```
Saves a lot of pointless API calls.
Comments and actions