Hyperlinkv0.8.0-beta.28

Cause

Cause.emptyconsteffect/Cause.ts:464
Cause<never>

Represents a Cause with an empty reasons array.

When to use

Use to represent the absence of failure when constructing or combining causes.

Details

Represents the absence of failure. Combining any cause with empty via combine returns the original cause unchanged.

Example (Combining with the empty cause)

import { Cause } from "effect"

const cause = Cause.combine(Cause.empty, Cause.fail("boom"))

console.log(cause.reasons.length) // 1
console.log(Cause.hasFails(cause)) // true
constructorscombine
Source effect/Cause.ts:4641 lines
export const empty: Cause<never> = core.causeEmpty