Hyperlinkv0.8.0-beta.28

Cause

Cause.doneconsteffect/Cause.ts:1405
<A = void>(value?: A): Effect.Effect<never, Done<A>>

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"
})
constructorsDone
Source effect/Cause.ts:14051 lines
export const done: <A = void>(value?: A) => Effect.Effect<never, Done<A>> = core.done
Referenced by 60 symbols