Answer the question
In order to leave comments, you need to log in
Old and slow query overwrites result of new fast query in Redux, how to deal?
Good afternoon, I ran into the problem of "race requests".
1. There is a page where a list of houses is displayed (stored in redux), in which I make a request to get Statistics for these houses for the last 5 years (statistics are also stored in redux, but separately from houses)
2. There is a page for a detailed view of the house, there I am requesting statistics for a house for the last 7 days.
The problem manifests itself if you quickly go from the listing of houses to the detailed view page.
Due to the fact that the request for 5 years fulfills longer - it comes later than the one that takes statistics for 7 days.
And it overwrites the data, as a result, with fast transitions, the data is not relevant.
How to deal with this, what is usually done in such situations?
I am using redux-thunk
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question