radiocosmology/padloper

Throttle server requests for `ComponentAutocomplete`

Opened this issue · 0 comments

Currently, when typing into the ComponentAutocomplete component, the web interface will query the Python API on each new keystroke. This is not ideal, and should instead be changed to only query the server (say) 500ms after the user's last input. This is known as "debouncing". The lodash library can help with this, or it can just be implemented manually.

Helpful links:
https://dmitripavlutin.com/react-throttle-debounce/
https://www.freecodecamp.org/news/debouncing-explained/

Material UI documentation:
https://mui.com/material-ui/react-autocomplete/#search-as-you-type