MCPcopy
hub / github.com/Effect-TS/effect / getFiberRef

Method getFiberRef

packages/effect/src/internal/fiberRuntime.ts:580–585  ·  view source on GitHub ↗

* Retrieves the state of the fiber ref, or else its initial value. * * **NOTE**: This method is safe to invoke on any fiber, but if not invoked * on this fiber, then values derived from the fiber's state (including the * log annotations and log level) may not be up-to-date.

(fiberRef: FiberRef.FiberRef<X>)

Source from the content-addressed store, hash-verified

578 * log annotations and log level) may not be up-to-date.
579 */
580 getFiberRef<X>(fiberRef: FiberRef.FiberRef<X>): X {
581 if (this._fiberRefs.locals.has(fiberRef)) {
582 return this._fiberRefs.locals.get(fiberRef)![0][1] as X
583 }
584 return fiberRef.initial
585 }
586
587 /**
588 * Sets the fiber ref to the specified value.

Callers 10

constructorMethod · 0.95
getInterruptedCauseMethod · 0.95
refreshRefCacheMethod · 0.95
isInterruptedMethod · 0.95
addInterruptedCauseMethod · 0.95
reportExitValueMethod · 0.95
getLoggersMethod · 0.95
logMethod · 0.95
runLoopMethod · 0.95

Calls 1

getMethod · 0.65

Tested by

no test coverage detected