redux-api-middleware icon indicating copy to clipboard operation
redux-api-middleware copied to clipboard

Handling Data Races

Open wgottschalk opened this issue 8 years ago • 1 comments
trafficstars

I want to build an autocomplete box. One of the requirements is that the user should always receive the latest input. I can throttle the inputs but that only works on a good connection. When I get to 3G network connectivity, I can end up getting multiple responses that may or may not be out of order.

What I need is a hook similar to the bailout, but it gets executed after the request has resolved, but before we dispatch the REQUEST_SUCCESS action.

wgottschalk avatar Oct 27 '17 17:10 wgottschalk

Maybe use debounce instead of throttling. Make only one request when user stops writing.

unrevised6419 avatar Feb 13 '18 19:02 unrevised6419