-
Say I have two useQuery hooks const {data: videos} = useQuery('videos', getVideos)
const {data: suggestions} = useQuery('suggestions', getSuggestions) Instead of combining their const {data: videos, isLoading: isLoadingVideos} = useQuery('videos', getVideos)
const {data: suggestions, isLoading: isLoadingSuggestions} = useQuery('suggestions', getSuggestions)
const isLoading = isLoadingVideos || isLoadingSuggestions Can we do this? const isFetching = useIsFetching(['videos', 'suggestions']) |
Beta Was this translation helpful? Give feedback.
Answered by
TkDodo
Feb 24, 2022
Replies: 1 comment 1 reply
-
you can use the
but keep in mind that there is no fuzzy matching when doing it like that. Alternatively, you can call |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
nguyenyou
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
you can use the
predicate
option:but keep in mind that there is no fuzzy matching when doing it like that. Alternatively, you can call
useIsFetching
twice and sum up the results.