Interface Failure<ERROR>

interface Failure<ERROR> {
    either: (<VALUE, NEW_ERROR>(onSuccess, onFailure) => Result<VALUE, NEW_ERROR>);
    inspect: (() => string);
    isSuccess: false;
    mBind: ((fn) => Failure<ERROR>);
    map: ((fn) => Failure<ERROR>);
    onComplete: ((consumer) => Failure<ERROR>);
    onFailure: ((consumer) => Failure<ERROR>);
    onSuccess: ((consumer) => Failure<ERROR>);
    or: (<NEW_ERROR>(fn) => Result<unknown, NEW_ERROR>);
    orElse: (<VALUE>(fallback) => VALUE);
    orNull: (() => null);
    reason: ERROR;
    toMaybe: (() => Nothing);
}

Type Parameters

  • ERROR

Properties

either: (<VALUE, NEW_ERROR>(onSuccess, onFailure) => Result<VALUE, NEW_ERROR>)

Type declaration

inspect: (() => string)

Type declaration

    • (): string
    • Returns string

isSuccess: false
mBind: ((fn) => Failure<ERROR>)

Type declaration

map: ((fn) => Failure<ERROR>)

Type declaration

onComplete: ((consumer) => Failure<ERROR>)

Type declaration

onFailure: ((consumer) => Failure<ERROR>)

Type declaration

onSuccess: ((consumer) => Failure<ERROR>)

Type declaration

or: (<NEW_ERROR>(fn) => Result<unknown, NEW_ERROR>)

Type declaration

orElse: (<VALUE>(fallback) => VALUE)

Type declaration

orNull: (() => null)

Type declaration

    • (): null
    • Returns null

reason: ERROR
toMaybe: (() => Nothing)

Type declaration