I have a react-redux application which:
- Loads N records from the database depending on a "limit" query parameter (by default 20 records) on first application load (initialization)
- Every 10 seconds app requests same (or newer) records from the database to update data in real time
- If a user changes filters - app requests new records from the database according to the filter and re-renders app (+ changes interval to load data according to the filters)
- If users scrolls down, the app automatically loads more records.
The problem is that if a user for and instance tries to filter something out and at this same time interval is loading more data, 2 requests can clash and overwrite each other. How in react-redux app I can be sure in a request sequence. Maybe there is a common approach on how to properly queue requests?
Thanks in advance!