Package: effect
Module: Context
Creates a new Context with a single service associated to the key.
Example (Creating a context with one service)
import { Context } from "effect"
import * as assert from "node:assert"
const Port = Context.Service<{ PORT: number }>("Port")
const context = Context.make(Port, { PORT: 8080 })
assert.deepStrictEqual(Context.get(context, Port), { PORT: 8080 })
Signature
declare const make: <I, S>(key: Key<I, S>, service: Types.NoInfer<S>) => Context<I>
Since v2.0.0