-
Notifications
You must be signed in to change notification settings - Fork 233
Add debounce function when typing #281
Comments
Hi @l2aelba, we do not natively support debouncing on purpose: we want Algolia Places to be really fast for everyone. People typing fast or people typing slower. Algolia Places uses https://github.com/algolia/autocomplete.js internally. If we ever wanted to implement debouncing, this is where we should first do it. It's true that Google Places for instance has some default debouncing internally, if you feel like trying I am not against reviewing a Pull Request that would implement debouncing as an option right here: places/src/createAutocompleteDataset.js Line 17 in ec6083d
It would look a bit like: return {
source: opts.debounce ? debounceImplementation(opts.debounce, source) : source,
templates,
displayKey: 'value',
name: 'places'
}; |
Closing this issue since we do not support debouncing on purpose in all Algolia clients. |
👍 #530 |
Did someone have found a workaround to add a debouncing ? Is there a native JS way to do that ? |
@pierremeteye Places is being shutdown on May 31st (in less than 3 months), as announced Nov 30th 2020 (464 days ago). I would strongly invite you to migrate to another autocomplete solution, that would be the workaround. see this announcement: https://www.algolia.com/blog/product/sunsetting-our-places-feature/ |
@JonathanMontane Oh thank you for the heads up ! :) |
If you meet anyone who is not aware of this, please do share it with them as well! We've reached out many times over the past year but we still see a sizeable amount of usage. |
Since im using ApiKey right now. Seems like place.js call the API every keyup.
Should place.js add some debounce function (delay/cooldown) when typing ?
For prevent calling alot of times for API ?
Example right now when im searching my place , It will call the API 5-9 times, So the limit going down too fast.
The text was updated successfully, but these errors were encountered: