I'm generally curious to what the best practice is for this. I'm making a http call to an API and pulling data based on a user's search query to use for search suggestions.
Do I:
A. Pull from the web api on every user keystroke, and displaying the results until the user finds their value.
B. Pull all the data first, about 200 items, and filter the data with the user's query, then display the suggestion data to the user.
If the dataset is small, you can download the entire list during initialization. However when the dataset is large, you should debounce the keypress event and only call the API after once in a while.