MCPcopy Create free account
hub / github.com/effect-app/libs / MyContextProviderGen

Class MyContextProviderGen

packages/infra/test/contextProvider.test.ts:69–89  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

67
68// @effect-diagnostics-next-line missingEffectServiceDependency:off
69class MyContextProviderGen extends Context.Service<MyContextProviderGen>()(
70 "MyContextProviderGen",
71 {
72 make: Effect.gen(function*() {
73 yield* SomeService
74 if (Math.random() > 0.5) return yield* new CustomError1()
75
76 return function*() {
77 // the only requirements you can have are the one provided by HttpLayerRouter.Provided
78 yield* Scope.Scope
79
80 yield* Effect.logInfo("MyContextProviderGen", "this is a generator")
81 yield* Effect.succeed("this is a generator")
82
83 return Some.context({ a: 1 })
84 }
85 })
86 }
87) {
88 static readonly Default = Layer.effect(this, this.make)
89}
90
91export const someContextProvider = ContextProvider({
92 effect: Effect.gen(function*() {

Callers

nothing calls this directly

Calls 2

contextMethod · 0.65
succeedMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…