effect-io-ai

Package: effect
Module: Exit

Exit.getOrElse

Returns the A if specified exit is a Success, otherwise returns the alternate A value computed from the specified function which receives the Cause<E> of the exit Failure.

Signature

declare const getOrElse: { <E, A2>(orElse: (cause: Cause.Cause<E>) => A2): <A>(self: Exit<A, E>) => A2 | A; <A, E, A2>(self: Exit<A, E>, orElse: (cause: Cause.Cause<E>) => A2): A | A2; }

Source

Since v2.0.0