I'd like to debounce the request for the auto-suggestion example in this repository. So when a user types a search term, it waits 3000 ms before it fires a network request on the search term.
I'm not really sure how to do this with useSWR and I was wondering if there is a way to throttle / debounce the requests?
Example from repo:
https://github.com/zeit/swr/blob/master/examples/autocomplete-suggestions/pages/index.js
I'd like to debounce the request for the auto-suggestion example in this repository. So when a user types a search term, it waits 3000 ms before it fires a network request on the search term.
I'm not really sure how to do this with
useSWRand I was wondering if there is a way to throttle / debounce the requests?Example from repo:
https://github.com/zeit/swr/blob/master/examples/autocomplete-suggestions/pages/index.js