Hyperlinkv0.8.0-beta.28

Context

Context.Keyinterfaceeffect/Context.ts:65
Key<Identifier, Shape>

Typed identifier for a service stored in a Context.

When to use

Use as the typed handle for storing, retrieving, and requiring a specific service in a Context.

Details

Identifier tracks the requirement in Effect types, while Shape is the service implementation retrieved by the key. A key is also an Effect value, so yielding it inside Effect.gen retrieves the service from the current fiber context.

Source effect/Context.ts:657 lines
export interface Key<out Identifier, out Shape> extends Effect<Shape, never, Identifier> {
  readonly [ServiceTypeId]: ServiceTypeId
  readonly Service: Shape
  readonly Identifier: Identifier
  readonly key: string
  readonly stack?: string | undefined
}
Referenced by 36 symbols