Open vdiaza opened 1 year ago
Maybe something like lodash‘s debounce function could do the trick on the change event handler.
@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.
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..