MCPcopy Create free account
hub / github.com/Effect-TS/effect / isStale

Function isStale

packages/effect/src/ui/Query.ts:5551–5558  ·  view source on GitHub ↗
(entry: Entry)

Source from the content-addressed store, hash-verified

5549
5550 // -- state ------------------------------------------------------------------
5551 const isStale = (entry: Entry): boolean =>
5552 settleOnce
5553 ? entry.result === undefined
5554 : entry.result === undefined || entry.result._tag === "Failure" ||
5555 entry.invalidated ||
5556 // A live stream keeps its entry fresh.
5557 (entry.live === undefined &&
5558 now() - entry.settledAt >= entry.def.staleMs)
5559 const hasLive = (entry: Entry): boolean => entry.patches.some((patch) => patch.live)
5560 /** Inside the fetch-free window, a hydrated entry. */
5561 const inWindow = (entry: Entry): boolean => windowOpen && entry.hydrated

Callers 7

watchFunction · 0.70
holdFunction · 0.70
getFunction · 0.70
prefetchFunction · 0.70
settleRunEntryFunction · 0.70
edgePassFunction · 0.70
buildCacheFunction · 0.70

Calls 1

nowFunction · 0.70

Tested by

no test coverage detected