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

Function replaceFetch

packages/effect/src/ui/Query.ts:6089–6100  ·  view source on GitHub ↗
(
    entry: Entry,
    fetch: FetchRec,
    parent: queryCore.SpanContext | undefined
  )

Source from the content-addressed store, hash-verified

6087 * a prefetch has. With no open build the entry reverts.
6088 */
6089 const replaceFetch = (
6090 entry: Entry,
6091 fetch: FetchRec,
6092 parent: queryCore.SpanContext | undefined
6093 ): void => {
6094 dropFetch(entry, fetch)
6095 const build = survivingBuild(entry) ??
6096 (fetch.build.closed ? undefined : fetch.build)
6097 if (build === undefined) return revert(entry)
6098 countRestart(entry)
6099 startFetch(entry, fetch.trigger, build, true, false, parent, fetch.watcher)
6100 }
6101 function buildClosed(build: Build): void {
6102 attached.delete(build)
6103 if (disposed) return

Callers 3

buildClosedFunction · 0.85
invalidateEntryFunction · 0.85
storeWriteFunction · 0.85

Calls 5

dropFetchFunction · 0.85
survivingBuildFunction · 0.85
revertFunction · 0.85
countRestartFunction · 0.85
startFetchFunction · 0.85

Tested by

no test coverage detected