MCPcopy Create free account
hub / github.com/TanStack/query / isDisabled

Method isDisabled

packages/query-core/src/query.ts:400–406  ·  view source on GitHub ↗

* Returns `true` if the query is disabled, meaning it will not fetch * automatically. * - If the query has observers, it is disabled when none of them are active * (see `isActive`). * - If the query has no observers, it is disabled when its `queryFn` is * `skipToken` or it has nev

()

Source from the content-addressed store, hash-verified

398 * `skipToken` or it has never been fetched.
399 */
400 isDisabled(): boolean {
401 if (this.getObserversCount() > 0) {
402 return !this.isActive()
403 }
404 // if a query has no observers, it should still be considered disabled if it never attempted a fetch
405 return this.options.queryFn === skipToken || !this.isFetched()
406 }
407
408 /**
409 * Returns `true` if the query has been fetched, i.e. it has resolved with

Callers 3

ContentViewFunction · 0.80
QueryRowFunction · 0.80
refetchQueriesMethod · 0.80

Calls 3

getObserversCountMethod · 0.95
isActiveMethod · 0.95
isFetchedMethod · 0.95

Tested by

no test coverage detected