/** * A more powerful variant of `withFinalizer` that allows the finalizer to * depend on the `Exit` value that the scope is closed with. * * @tsplus static effect/core/io/Effect.Aspects withFinalizerExit * @tsplus pipeable effect/core/io/Effect withFinalizerExit */ export function withFinalizerExit( finalizer: (exit: Exit) => Effect ) { return (self: Effect): Effect => Effect.acquireReleaseExit(self, (_, exit) => finalizer(exit)) }