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

Method isDisabled

packages/query-core/src/query.ts:486–492  ·  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

484 * @returns `true` if the query is disabled.
485 */
486 isDisabled(): boolean {
487 if (this.getObserversCount() > 0) {
488 return !this.isActive()
489 }
490 // if a query has no observers, it should still be considered disabled if it never attempted a fetch
491 return this.options.queryFn === skipToken || !this.isFetched()
492 }
493
494 /**
495 * 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