Interface Success<VALUE>

interface Success<VALUE> {
    either: (<NEW_VALUE, ERROR>(onSuccess, onFailure) => Result<NEW_VALUE, ERROR>);
    inspect: (() => string);
    isSuccess: true;
    mBind: (<NEW_VALUE>(fn) => Result<NEW_VALUE, unknown>);
    map: (<NEW_VALUE>(fn) => Success<NEW_VALUE>);
    onComplete: ((consumer) => Success<VALUE>);
    onFailure: ((consumer) => Success<VALUE>);
    onSuccess: ((consumer) => Success<VALUE>);
    or: ((fn) => Success<VALUE>);
    orElse: ((fallback) => VALUE);
    orNull: (() => VALUE);
    toMaybe: (() => Some<VALUE>);
    value: VALUE;
}

Type Parameters

  • VALUE

Properties

either: (<NEW_VALUE, ERROR>(onSuccess, onFailure) => Result<NEW_VALUE, ERROR>)

Type declaration

inspect: (() => string)

Type declaration

    • (): string
    • Returns string

isSuccess: true
mBind: (<NEW_VALUE>(fn) => Result<NEW_VALUE, unknown>)

Type declaration

map: (<NEW_VALUE>(fn) => Success<NEW_VALUE>)

Type declaration

onComplete: ((consumer) => Success<VALUE>)

Type declaration

onFailure: ((consumer) => Success<VALUE>)

Type declaration

onSuccess: ((consumer) => Success<VALUE>)

Type declaration

or: ((fn) => Success<VALUE>)

Type declaration

orElse: ((fallback) => VALUE)

Type declaration

    • (fallback): VALUE
    • Parameters

      • fallback: unknown

      Returns VALUE

orNull: (() => VALUE)

Type declaration

toMaybe: (() => Some<VALUE>)

Type declaration

value: VALUE