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

Function makeGenericTag

packages/effect/src/internal/context.ts:70–83  ·  view source on GitHub ↗
(key: string)

Source from the content-addressed store, hash-verified

68
69/** @internal */
70export const makeGenericTag = <Identifier, Service = Identifier>(key: string): C.Tag<Identifier, Service> => {
71 const limit = getStackTraceLimit()
72 setStackTraceLimit(2)
73 const creationError = new Error()
74 setStackTraceLimit(limit)
75 const tag = Object.create(TagProto)
76 Object.defineProperty(tag, "stack", {
77 get() {
78 return creationError.stack
79 }
80 })
81 tag.key = key
82 return tag
83}
84
85/** @internal */
86export const Tag = <const Id extends string>(id: Id) => <Self, Shape>(): C.TagClass<Self, Id, Shape> => {

Callers

nothing calls this directly

Calls 3

createMethod · 0.80
getStackTraceLimitFunction · 0.70
setStackTraceLimitFunction · 0.70

Tested by

no test coverage detected