Might Fail
GitHub Repo stars

Function: Fail()

function Fail<T>(error: unknown): Either<T>
function Fail<T>(error: unknown): Either<T>
function Fail<T>(error: unknown): Either<T>
function Fail<T>(error: unknown): Either<T>

A constructor function that takes an error and returns an Either object with undefined as the result and the error as the error.

The error will always be an instance of Error.

Type Parameters

Type ParameterDefault type
Tany

Parameters

ParameterTypeDescription
errorunknown

Returns

Either<T>