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

Method isStatic

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

* Returns `true` if the query has at least one observer configured with * `staleTime: 'static'`, meaning it is treated as never stale.

()

Source from the content-addressed store, hash-verified

418 * `staleTime: 'static'`, meaning it is treated as never stale.
419 */
420 isStatic(): boolean {
421 if (this.getObserversCount() > 0) {
422 return this.observers.some(
423 (observer) =>
424 resolveQueryValue(observer.options.staleTime, this) === 'static',
425 )
426 }
427
428 return false
429 }
430
431 /**
432 * Returns `true` if the query is stale.

Callers 2

QueryRowFunction · 0.80
refetchQueriesMethod · 0.80

Calls 2

getObserversCountMethod · 0.95
resolveQueryValueFunction · 0.90

Tested by

no test coverage detected