Hyperlinkv0.8.0-beta.28

Exit

Exit.asVoidconsteffect/Exit.ts:955
<A, E>(self: Exit<A, E>): Exit<void, E>

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
combinatorsvoid_asVoidAll
Source effect/Exit.ts:9551 lines
export const asVoid: <A, E>(self: Exit<A, E>) => Exit<void, E> = effect.exitAsVoid