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

Function fetchOnce

packages/effect/src/ui/Query.ts:6130–6138  ·  view source on GitHub ↗
(
    def: QueryDef,
    build: Build,
    args: unknown,
    logKey: () => string
  )

Source from the content-addressed store, hash-verified

6128 // -- caller-only fetches ----------------------------------------------------
6129 /** A fetcher call for its callers alone. A stream query's is its first element. */
6130 const fetchOnce = (
6131 def: QueryDef,
6132 build: Build,
6133 args: unknown,
6134 logKey: () => string
6135 ): Effect.Effect<any, any> => {
6136 const out = build.fetcher(args)
6137 return def.live === undefined ? out : def.live.once(def, out, logKey)
6138 }
6139 /**
6140 * Like a stored fetch, a caller-only one starts only once what it replaces has finished its cleanup: the stored
6141 * fetch it was converted from, or its own fetch under a build that closed.

Callers 2

runSharedFunction · 0.85
getFunction · 0.85

Calls 1

onceMethod · 0.80

Tested by

no test coverage detected