getOrElse
getOrElse<
E,A,B>(defaultValue): (data) =>A|B
Defined in: Core/Result.ts:155
Returns the success value or a default value if the Result is an error.
The default is a thunk () => B — evaluated only when the Result is Err.
The default can be a different type, widening the result to A | B.
Type Parameters
Section titled “Type Parameters”E
A
B
Parameters
Section titled “Parameters”defaultValue
Section titled “defaultValue”() => B
Returns
Section titled “Returns”(
data):A|B
Parameters
Section titled “Parameters”Result<E, A>
Returns
Section titled “Returns”A | B