effect-io-ai

Package: effect
Module: Exit

Exit.asVoid

Discards the success value of an Exit, replacing it with void.

When to use

Use when you need to discard a successful Exit value while preserving whether the Exit succeeded or failed.

Details

Failures pass through unchanged.

Allocates a new Exit if successful.

Example (Discarding the success value)

import { Exit } from "effect"

const exit = Exit.succeed(42)
const voided = Exit.asVoid(exit)
console.log(Exit.isSuccess(voided)) // true

See

Signature

declare const asVoid: <A, E>(self: Exit<A, E>) => Exit<void, E>

Source

Since v2.0.0