Redux – handling multiple concurrent requests


In all Redux examples and documentation, the example is shown when handling asynchronous requests with a Boolean value. Normally, retrieval is set to true when a request is made, and false if successful or unsuccessful.

When I load a page, several API calls are made by multiple components. I want to display a load flag when making a request to the API. Therefore, this may not be the best solution:

  1. Action1 turns isFetching to true and starts getting API
  2. Action2 switches isFetching to true and starts getting API
  3. Action1 is finished, switching to isFetching false, even though Action2 is still loading.

How would you solve such situations?

Many Thanks!