effect-io-ai

Package: effect
Module: Exit

Exit.isSuccess

Checks whether an Exit is a Success.

When to use

Use as a type guard to narrow Exit<A, E> to Success<A, E> and access the value property.

Example (Narrowing to success)

import { Exit } from "effect"

const exit = Exit.succeed(42)

if (Exit.isSuccess(exit)) {
  console.log(exit.value) // 42
}

See

Signature

declare const isSuccess: <A, E>(self: Exit<A, E>) => self is Success<A, E>

Source

Since v2.0.0