JM Santos
Dec 3, 2020

--

I'm thinking of two approaches to handle that case:

1. Since I've mentioned a lot the creation of non-hook version of the API calls. We can do a composition of those API call functions, or in other words, combine them in a one API call. In that way, you will don't have to worry maintaining each state of the API call.

2. If you don't have the non-hook version of the API calls and all are in hooks. The least we can do to get a better glance on it is by assigning the state on a temporary variable. See the following:

```

const hasError = error0 || error1 || error2;

const isLoading = isLoading0 || isLoading1 || isLoading2;

if (hasError) { ... }

if (isLoading) { ... }

```

Hope that helps!

--

--

JM Santos
JM Santos

No responses yet