Hyperlinkv0.8.0-beta.28

Scope

Scope.closeUnsafeconsteffect/Scope.ts:545
<A, E>(self: Scope, exit_: Exit<A, E>):
  | Effect<void, never, never>
  | undefined

Closes a scope unsafely with the provided exit value.

When to use

Use when implementing lower-level scope machinery that must transition a scope to Closed immediately and can run the returned finalizer effect when one is produced.

Details

Returns an effect that runs registered finalizers, or undefined when the scope was already closed or no finalizers need to run.

Gotchas

Ignoring the returned effect skips registered finalizers.

unsafeclose
Source effect/Scope.ts:5452 lines
export const closeUnsafe: <A, E>(self: Scope, exit_: Exit<A, E>) => Effect<void, never, never> | undefined =
  effect.scopeCloseUnsafe