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

Function scopedContext

packages/effect/src/internal/layer.ts:958–965  ·  view source on GitHub ↗
(
  effect: Effect.Effect<Context.Context<A>, E, R>
)

Source from the content-addressed store, hash-verified

956
957/** @internal */
958export const scopedContext = <A, E, R>(
959 effect: Effect.Effect<Context.Context<A>, E, R>
960): Layer.Layer<A, E, Exclude<R, Scope.Scope>> => {
961 const scoped = Object.create(proto)
962 scoped._op_layer = OpCodes.OP_SCOPED
963 scoped.effect = effect
964 return scoped
965}
966
967/** @internal */
968export const scope: Layer.Layer<Scope.Scope> = scopedContext(

Callers 2

layer.tsFile · 0.85
scopedDiscardFunction · 0.85

Calls 1

createMethod · 0.80

Tested by

no test coverage detected