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

Function abandonFetch

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

Source from the content-addressed store, hash-verified

6322 }
6323 /** Interrupts an unwatched entry's fetch unless a `get` waits on it or a prefetch keeps it. */
6324 const abandonFetch = (entry: Entry): boolean => {
6325 const fetch = entry.fetch
6326 if (
6327 entry.watchers.size > 0 || fetch === undefined ||
6328 fetch.trigger !== "watch" || entry.kept ||
6329 entry.waiters.size > 0 || entry.moreWaiters.size > 0
6330 ) return false
6331 dropFetch(entry, fetch)
6332 revert(entry)
6333 return true
6334 }
6335
6336 // -- hold -------------------------------------------------------------------
6337 let holds = 0

Callers 2

watchFunction · 0.85
holdFunction · 0.85

Calls 2

dropFetchFunction · 0.85
revertFunction · 0.85

Tested by

no test coverage detected