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

Function withCapture

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

Source from the content-addressed store, hash-verified

244
245// Helper: provide a fresh `InvalidationKeysFromServer` and capture forwarded keys.
246const withCapture = <A, E, R>(eff: Effect.Effect<A, E, R>) =>
247 Effect.gen(function*() {
248 const ref = yield* Ref.make<ReadonlyArray<Invalidation.InvalidationKey>>([])
249 const svc = makeInvalidationKeysService(ref)
250 const result = yield* eff.pipe(Effect.provideService(InvalidationKeysFromServer, svc), Effect.exit)
251 return { result, keys: yield* Ref.get(ref) }
252 })
253
254const withDependencyCapture = <A, E, R>(eff: Effect.Effect<A, E, R>) =>
255 Effect.gen(function*() {

Callers 1

Calls 4

makeMethod · 0.65
pipeMethod · 0.65
getMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…