MCPcopy Create free account
hub / github.com/Effect-TS/effect / scopedWith

Function scopedWith

packages/effect/src/internal/fiberRuntime.ts:2873–2875  ·  view source on GitHub ↗
(
  f: (scope: Scope.Scope) => Effect.Effect<A, E, R>
)

Source from the content-addressed store, hash-verified

2871
2872/** @internal */
2873export const scopedWith = <A, E, R>(
2874 f: (scope: Scope.Scope) => Effect.Effect<A, E, R>
2875): Effect.Effect<A, E, R> => core.flatMap(scopeMake(), (scope) => core.onExit(f(scope), (exit) => scope.close(exit)))
2876
2877/* @internal */
2878export const scopedEffect = <A, E, R>(effect: Effect.Effect<A, E, R>): Effect.Effect<A, E, Exclude<R, Scope.Scope>> =>

Callers 1

fiberRuntime.tsFile · 0.70

Calls 4

scopeMakeFunction · 0.85
onExitMethod · 0.65
closeMethod · 0.65
fFunction · 0.50

Tested by

no test coverage detected