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

Class MyContextProvider

packages/infra/test/contextProvider.test.ts:12–32  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10
11// @effect-diagnostics-next-line missingEffectServiceDependency:off
12class MyContextProvider extends Context.Service<MyContextProvider>()(
13 "MyContextProvider",
14 {
15 make: Effect.gen(function*() {
16 yield* SomeService
17 if (Math.random() > 0.5) return yield* new CustomError1()
18
19 return Effect.gen(function*() {
20 // the only requirements you can have are the one provided by HttpLayerRouter.Provided
21 yield* Scope.Scope
22
23 yield* Effect.logInfo("MyContextProviderGen", "this is a generator")
24 yield* Effect.succeed("this is a generator")
25
26 return Some.context({ a: 1 })
27 })
28 })
29 }
30) {
31 static readonly Default = Layer.effect(this, this.make)
32}
33
34class MyContextProvider2 extends Context.Service<MyContextProvider2>()(
35 "MyContextProvider2",

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…