Capítulo 66 de 80
Reactive hook wrapper around queryClient.isFetching() — subscribes to the count of currently-fetching queries (optionally filtered) without manually wiring a QueryCache subscription, the standard building block for an app-wide loading indicator.
filters (QueryFilters): scope the count to a key prefix/predicate — e.g. useIsFetching({ queryKey: ['posts'] }) for a section-specific indicator instead of global.queryClient: optional explicit override, defaults to context.const isFetching = useIsFetching() // app-wide count
const isFetchingPosts = useIsFetching({ queryKey: ['posts'] }) // scoped count
queryClient.isFetching() — use the hook inside components, the imperative method outside React.filters for section-level indicators rather than always going global.isFetching(), the imperative equivalent.