0

Does any existing react/redux related package handle Ajax race-conditions?

  1. If the user clicks on "Blue" or "Peter", and the screen is supposed to update info for the product to blue or show messages from Peter.

  2. But the server is slow, and after 3, 4 seconds the user is impatient and clicks on "Red" or "Michael", and the response comes back and populates the content with the Red or messages from Michael.

  3. Now the first Ajax comes back, and causes the reducer to fill the Redux store with "Blue" or "Peter" info.

A desirable behavior is to ignore the first response. (However, if there is another Ajax that is unrelated to this, such as getting info for "How does this work?", then this Ajax response can be handled.)

Does any react/redux related package, or redux-thunk, redux-saga, or redux-promise already have mechanism built in to handle this situation?

Jeremy L
  • 3,580
  • 5
  • 36
  • 60

0 Answers0