effect-io-ai

Package: effect
Module: Effect

Effect.onExitPrimitive

Runs an optional finalizer with the effect’s Exit value when the effect completes.

When to use

Use when you are building a low-level Effect operator that must inspect the source effect’s Exit, may skip finalization by returning undefined, or must choose whether finalization is forced into an uninterruptible region.

Details

This low-level operator preserves the source effect’s result unless the finalizer fails. Prefer onExit for normal cleanup logic.

See

Signature

declare const onExitPrimitive: <A, E, R, XE = never, XR = never>(self: Effect<A, E, R>, f: (exit: Exit.Exit<A, E>) => Effect<void, XE, XR> | undefined, interruptible?: boolean) => Effect<A, E | XE, R | XR>

Source

Since v4.0.0