useQueries manual aggregation #2004
-
Problem
SuggestionBefore:
After:
Would you consider adjusting the API do provide this aggregated information? It would help reducing unnecessary boilerplate and align the usage of |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
It depends on the use case. You might want to display a loading spinner while at least one query is loading, others might want to show data as soon as it’s available and only show a spinner while all queries are loading. That’s why the api is un-opinionated. For your use-case you can easily make a custom hook with 5 lines of code that encapsulates the |
Beta Was this translation helpful? Give feedback.
It depends on the use case. You might want to display a loading spinner while at least one query is loading, others might want to show data as soon as it’s available and only show a spinner while all queries are loading.
That’s why the api is un-opinionated. For your use-case you can easily make a custom hook with 5 lines of code that encapsulates the
results.some(...)
logic and use that over directly calling useQueries.