Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Place Autocomplete Debounce #201

Open
vdiaza opened this issue Sep 26, 2023 · 2 comments
Open

Place Autocomplete Debounce #201

vdiaza opened this issue Sep 26, 2023 · 2 comments

Comments

@vdiaza
Copy link

vdiaza commented Sep 26, 2023

Is your feature request related to a problem? Please describe.
Google maps autocomplete becomes very expensive on a large scale, this is due that it performs a request each time a key is pressed.

Describe the solution you'd like
Best way to avoid sending too many requests is to add a debounce feature to wait x ms before sending a new request..

@wavedeck
Copy link

Maybe something like lodash‘s debounce function could do the trick on the change event handler.

@chronicadventure
Copy link

chronicadventure commented Feb 5, 2024

@wavedeck what do you mean add a debounce function on the change event handler? Are you talking about adding it to the place_changed event? If that's the case, that event is only fired when a user actually selects an item from the drop down, not when a key stroke is pressed.

Having said that, I think the way google bills is per "session", in which a session includes the autocomplete suggestions with a final getplacedetails call. So the billing issue might not be that big of a problem.

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

No branches or pull requests

3 participants