useErrors
#1634
Replies: 1 comment
-
Sounds like a great idea. It'll be great having especially in cases where you want to display an error message or do something else in components that depends on a particular query state. I don't know if anyone gets my point here! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
What would we think about a dedicated
useErrors
hook to be able to display errors globally, similar touseIsFetching
?instead of the number of fetching queries, we could return a map of queryKey -> error for all queries that are in error state (+ the usual filter options).
we’ve had this use case, and creating subscriptions with
useQuery
just to display errors was cumbersome because building the keys involved subscribing to redux (where part of the queryKey lives). A global hook would solve this nicely -useErrorBoundary
would be the other alternative, so we have options if this idea is not gonna make it :)Beta Was this translation helpful? Give feedback.
All reactions