Const
Readonly
error: <Error, Success>(error: Error) => Either<Error, Success>create an either in error state with a given error
Readonly
fromTryCatch: <Success>(fn: () => Success) => Either<unknown, Success>Create an either from a function that can throw an exeption. Either get the value or the exeption.
Readonly
fromTryCatchAsync: <Success>(fn: () => Promise<Success>) => EitherAsync<unknown, Success>Create an either from an asynchrone function that can throw an exeption. Either get the value or the exeption.
Readonly
success: <Error, Success>(value: Success) => Either<Error, Success>create an either in success state with a given value
either utilities