cch5ng / rest_countries_api_fementor

Front-end project showing modular component organization and React (hooks) development.
https://rest-countries-api-fementor.vercel.app/
1 stars 0 forks source link

debounce (search input) #28

Open cch5ng opened 4 years ago

cch5ng commented 4 years ago

resc

https://www.geeksforgeeks.org/debouncing-in-javascript/

https://dev.to/gabe_ragland/debouncing-with-react-hooks-jci

https://medium.com/@anuhosad/debouncing-events-with-react-b8c405c33273

cch5ng commented 4 years ago

I'm not sure debounce is important bc I'm not make repeat api calls when someone types text into the search input

probably might do something like track the timestamp (ms) of the last input change, if the current timestamp is less than 0.3 sec or 0.4 sec then wait to update the input; estimate what is like the max typing speed and try to figure out what the threshold should be like for updating the input val