MCPcopy
hub / github.com/Effect-TS/effect / makeLayer2

Function makeLayer2

packages/effect/test/Layer.test.ts:779–787  ·  view source on GitHub ↗
(ref: Ref.Ref<Chunk.Chunk<string>>)

Source from the content-addressed store, hash-verified

777}
778export const Service2Tag = Context.GenericTag<Service2>("Service2")
779export const makeLayer2 = (ref: Ref.Ref<Chunk.Chunk<string>>): Layer.Layer<Service2> => {
780 return Layer.scoped(
781 Service2Tag,
782 Effect.acquireRelease(
783 ref.pipe(Ref.update(Chunk.append(acquire2)), Effect.as(new Service2())),
784 () => Ref.update(ref, Chunk.append(release2))
785 )
786 )
787}
788export class Service3 {
789 three(): Effect.Effect<number> {
790 return Effect.succeed(3)

Callers 1

Layer.test.tsFile · 0.85

Calls 2

pipeMethod · 0.65
updateMethod · 0.65

Tested by

no test coverage detected