MCPcopy
hub / github.com/TanStack/query / isStale

Function isStale

packages/query-core/src/queryObserver.ts:801–809  ·  view source on GitHub ↗
(
  query: Query<any, any, any, any>,
  options: QueryObserverOptions<any, any, any, any, any>,
)

Source from the content-addressed store, hash-verified

799}
800
801function isStale(
802 query: Query<any, any, any, any>,
803 options: QueryObserverOptions<any, any, any, any, any>,
804): boolean {
805 return (
806 resolveEnabled(options.enabled, query) !== false &&
807 query.isStaleByTime(resolveStaleTime(options.staleTime, query))
808 )
809}
810
811// this function would decide if we will update the observer's 'current'
812// properties after an optimistic reading via getOptimisticResult

Callers 4

QueryRowFunction · 0.85
createResultMethod · 0.85
shouldFetchOnFunction · 0.85
shouldFetchOptionallyFunction · 0.85

Calls 3

resolveEnabledFunction · 0.90
resolveStaleTimeFunction · 0.90
isStaleByTimeMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…