My app updates every time text is typed. Then using debounce on an axios request, the requests are queued up until the timer runs out, and then they all go at once. I am trying to limit the requests to one per 10 second period. Where am I going wrong?
I'm doing this in ReactJS if that's of consequence.
const debouncedSync = _.debounce(() => {this.sync () }, 10000);
sync = (requestBody) => {
axios.post('http://127.0.0.1:8000/Server/', requestBody);
};