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

Function buildOf

packages/effect/src/ui/Query.ts:5515–5535  ·  view source on GitHub ↗
(fetcher: Fetcher)

Source from the content-addressed store, hash-verified

5513
5514 // -- builds -----------------------------------------------------------------
5515 const buildOf = (fetcher: Fetcher): Build => {
5516 let build = (fetcher as { readonly [BuildTypeId]?: Build })[BuildTypeId]
5517 if (build === undefined) {
5518 build = fakeBuilds.get(fetcher)
5519 if (build === undefined) {
5520 build = {
5521 fetcher,
5522 closed: false,
5523 listeners: new Set(),
5524 fibers: new Set()
5525 }
5526 fakeBuilds.set(fetcher, build)
5527 }
5528 return build
5529 }
5530 if (!build.closed && !attached.has(build)) {
5531 attached.add(build)
5532 build.listeners.add(buildClosed)
5533 }
5534 return build
5535 }
5536 /** The build the cache uses when it asks itself: the earliest live watcher's, then a waiter's. */
5537 const survivingBuild = (entry: Entry): Build | undefined => {
5538 for (const watcher of entry.watchers) {

Callers 3

watchFunction · 0.85
getFunction · 0.85
prefetchFunction · 0.85

Calls 4

getMethod · 0.65
setMethod · 0.65
hasMethod · 0.65
addMethod · 0.65

Tested by

no test coverage detected