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

Function scoped

packages/platform/src/HttpApp.ts:177–184  ·  view source on GitHub ↗
(effect: Effect.Effect<A, E, R>)

Source from the content-addressed store, hash-verified

175)
176
177const scoped = <A, E, R>(effect: Effect.Effect<A, E, R>) =>
178 Effect.flatMap(Scope.make(), (scope) =>
179 Effect.onExit(Scope.extend(effect, scope), (exit) => {
180 if (ejectedScopes.has(scope)) {
181 return Effect.void
182 }
183 return Scope.close(scope, exit)
184 }))
185
186/**
187 * @since 1.0.0

Callers 1

toHandledFunction · 0.70

Calls 3

makeMethod · 0.65
onExitMethod · 0.65
closeMethod · 0.65

Tested by

no test coverage detected