DEV Community

Discussion on: How to use debouncing to Improve the performance of the search functionality

Collapse
 
michaelphipps profile image
Phippsy • Edited

Random: Not a React coder at all, but a thought on how to Improve this further... after you call the api, as the user continues typing .filter() existing results. then you only need to call the api again if the user changes the initial query text or filter returns nothing and user continues typing (in case the original result was paged excluding the required result) If API returns 0, and user keeps typing without changing original query text you also dont need to hit the api again.

Collapse
 
myogeshchavan97 profile image
Yogesh Chavan

Really Nice suggestion. Thanks 👍