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

Function scoped

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

Source from the content-addressed store, hash-verified

167)
168
169const scoped = <A, E, R>(effect: Effect.Effect<A, E, R>) =>
170 Effect.flatMap(Scope.make(), (scope) =>
171 Effect.onExit(Scope.extend(effect, scope), (exit) => {
172 if (ejectedScopes.has(scope)) {
173 return Effect.void
174 }
175 return Scope.close(scope, exit)
176 }))
177
178/**
179 * @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