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

Function withDependencyCapture

packages/infra/test/rpc-e2e-invalidation.test.ts:254–261  ·  view source on GitHub ↗
(eff: Effect.Effect<A, E, R>)

Source from the content-addressed store, hash-verified

252 })
253
254const withDependencyCapture = <A, E, R>(eff: Effect.Effect<A, E, R>) =>
255 Effect.gen(function*() {
256 const readsRef = yield* Ref.make(DataDependencies.empty())
257 const writesRef = yield* Ref.make(DataDependencies.empty())
258 const svc = DataDependencies.makeDataDependencyRecorder(readsRef, writesRef)
259 const result = yield* eff.pipe(Effect.provideService(DataDependencies.DataDependencyRecorder, svc), Effect.exit)
260 return { result, dependencies: yield* svc.get }
261 })
262
263// ---------------------------------------------------------------------------
264// Tests

Callers 1

Calls 2

makeMethod · 0.65
pipeMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…