Skip to content
This repository has been archived by the owner on Feb 2, 2023. It is now read-only.

Add debounce function when typing #281

Closed
l2aelba opened this issue Jul 13, 2016 · 7 comments
Closed

Add debounce function when typing #281

l2aelba opened this issue Jul 13, 2016 · 7 comments

Comments

@l2aelba
Copy link

l2aelba commented Jul 13, 2016

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.

@vvo
Copy link
Contributor

vvo commented Jul 13, 2016

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:

It would look a bit like:

  return {
    source: opts.debounce ? debounceImplementation(opts.debounce, source) : source,
    templates,
    displayKey: 'value',
    name: 'places'
  };

@vvo vvo added the send a PR label Jul 13, 2016
@raphi
Copy link
Contributor

raphi commented Jun 1, 2017

Closing this issue since we do not support debouncing on purpose in all Algolia clients.

@cesutherland
Copy link

👍 #530

@pierremeteye
Copy link

Did someone have found a workaround to add a debouncing ? Is there a native JS way to do that ?

@JonathanMontane
Copy link
Contributor

@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/

@pierremeteye
Copy link

@JonathanMontane Oh thank you for the heads up ! :)

@JonathanMontane
Copy link
Contributor

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants