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

Function isStale

packages/query-core/src/queryObserver.ts:784–792  ·  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

782}
783
784function isStale(
785 query: Query<any, any, any, any>,
786 options: QueryObserverOptions<any, any, any, any, any>,
787): boolean {
788 return (
789 resolveQueryBoolean(options.enabled, query) !== false &&
790 query.isStaleByTime(resolveStaleTime(options.staleTime, query))
791 )
792}
793
794// this function would decide if we will update the observer's 'current'
795// properties after an optimistic reading via getOptimisticResult

Callers 4

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

Calls 3

resolveQueryBooleanFunction · 0.90
resolveStaleTimeFunction · 0.90
isStaleByTimeMethod · 0.80

Tested by

no test coverage detected