gis-ops / valhalla-app

This is the demo web app running on https://valhalla.openstreetmap.de
https://valhalla.openstreetmap.de
MIT License
163 stars 90 forks source link

Closes (#121) #135

Closed sandstone991 closed 1 year ago

sandstone991 commented 1 year ago

🛠️ Fixes Issue

Debounce Isochrone API calls #121

👨‍💻 Changes proposed

Changed the UNSAFE_ComponentWillUpdate lifecycle which was ran on every change to see if the sliders values had changed to send a new request, made the component call a debounced fetch function on change instead. As for the sliders they make request only on the mouseUp event (user let go of the slider).

📄 Note to reviewers

I encounted two bugs (unrelated to the task) while working on this component.

I'm also dissatisfied with how async calls are done within this component, given unfortuante enough cirumstances a race condition like this can happen image

but I think that have to wait until the components are rewritten into functional components

Also please consider this a pre-gsoc pr

sandstone991 commented 1 year ago

@nilsnolde kindly review this