effect-io-ai

Package: effect
Module: Cause

Cause.done

Creates an Effect that fails with a Done error. Shorthand for Effect.fail(Cause.Done(value)).

When to use

Use when you model stream or queue completion through the error channel.

Example (Failing with Done)

import { Cause, Effect } from "effect"

const program = Cause.done("finished")

Effect.runPromiseExit(program).then((exit) => {
  console.log(exit._tag) // "Failure"
})

See

Signature

declare const done: <A = void>(value?: A) => Effect.Effect<never, Done<A>>

Source

Since v4.0.0