Closed achadee closed 2 months ago
Sorry, this is intentional, a debounced search box will give users the perception of a much slower experience than it actually could be.
Aside of that, it's indeed possible to debounce yourself as in the example, although you just delay every call instead of debouncing, that means you're still doing the same amount of queries, just slower.
What you'll want to do more likely is:
https://codesandbox.io/s/fast-currying-3dp59?file=/src/App.js
@Haroenv its slower, but its much cheaper. Algolia charges per search request, 100ms delay is a very reasonable compromise for businesses that have a budget.
Also, i'm not delaying every request, clearTimeout
negates previous requests if the next character is typed
The autocomplete feature should offer a delay prop, to avoid unnecessary queries when typing fast.
I had to implement it manually like so:
This is a standard feature in most Autocomplete modules and a lot of search engines offer a delay :)