Avoiding fetch many times when fetching by text?
I have a react-query hook that goes like this:
The problem is, everytime
searchParam changes it fetches again. So technically, many users fetching can cause a mini DDoS in this route. Is there a way to delay this fetching until the user stops inputing from keyboard?3 Replies
exotic-emeraldOP•3y ago
I want to know if react-query has something bulti-in to handle this, someone figured out that using
debounce from lodash but i dislike having to install another lib to handle this
So what I'm looking for is pretty much debouncing without another piece of codexenial-black•3y ago
It's out of scope for react-query how you manage the client state. If you want to debounce the searchParams, you have to do it outside of RQ
exotic-emeraldOP•3y ago
I understand. Thanks