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

Function Tag

packages/effect/src/internal/context.ts:86–101  ·  view source on GitHub ↗
(id: Id)

Source from the content-addressed store, hash-verified

84
85/** @internal */
86export const Tag = <const Id extends string>(id: Id) => <Self, Shape>(): C.TagClass<Self, Id, Shape> => {
87 const limit = getStackTraceLimit()
88 setStackTraceLimit(2)
89 const creationError = new Error()
90 setStackTraceLimit(limit)
91
92 function TagClass() {}
93 Object.setPrototypeOf(TagClass, TagProto)
94 TagClass.key = id
95 Object.defineProperty(TagClass, "stack", {
96 get() {
97 return creationError.stack
98 }
99 })
100 return TagClass as any
101}
102
103/** @internal */
104export const Reference = <Self>() =>

Callers

nothing calls this directly

Calls 2

getStackTraceLimitFunction · 0.70
setStackTraceLimitFunction · 0.70

Tested by

no test coverage detected