DEV Community

Discussion on: React Beginner Question Thread ⚛

Collapse
 
uptickr profile image
Uptickr • Edited

Hi Dan.

I have a React-Redux Web App where I make 5 different API calls in an action to get 5 different data sets that all need to be in the redux store before the app can function.

I'm using redux-thunk as middleware.

Problem is when one of the APIs doesn't respond for some reason, or responds too late, the app breaks.

Here's the pseudocode...
thepracticaldev.s3.amazonaws.com/i...

Can you suggest a better way of going about solving a situation like this?

Thanks!

Collapse
 
dan_abramov profile image
Dan Abramov

You want to handle the error case as well (and maybe show a “retry” button).

This example does it: github.com/reactjs/redux/tree/mast...