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

Function getDefaultValue

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

Source from the content-addressed store, hash-verified

1038const defaultValueCacheKey = "~effect/Context/defaultValue" as const
1039
1040const getDefaultValue = (ref: Reference<any>) => {
1041 if (defaultValueCacheKey in ref) {
1042 return ref[defaultValueCacheKey] as any
1043 }
1044 return (ref as any)[defaultValueCacheKey] = ref.defaultValue()
1045}
1046
1047const serviceNotFoundError = (service: Key<any, any>) => {
1048 const error = new Error(

Callers 1

Context.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected