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

Function getDefaultValue

packages/effect/src/Context.ts:1162–1167  ·  view source on GitHub ↗
(ref: Reference<any>)

Source from the content-addressed store, hash-verified

1160const defaultValueCacheKey = "~effect/Context/defaultValue" as const
1161
1162const getDefaultValue = (ref: Reference<any>) => {
1163 if (defaultValueCacheKey in ref) {
1164 return ref[defaultValueCacheKey] as any
1165 }
1166 return (ref as any)[defaultValueCacheKey] = ref.defaultValue()
1167}
1168
1169/**
1170 * Shares the runtime default with reference lookups without changing

Callers 2

Context.tsFile · 0.85
getReferenceUnsafeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected