Represent either a result, or an error.

Type Parameters

  • ValueT

    type of the resulting value

  • ErrorT

    type of the error

Hierarchy

  • Either

Constructors

Properties

Methods

Constructors

  • Type Parameters

    • ValueT

    • ErrorT

    Parameters

    • value: ValueT
    • error: ErrorT

    Returns Either<ValueT, ErrorT>

Properties

error: ErrorT

error if something failed

value: ValueT

value if something successful

Methods

  • Assert that value is set and return it.

    Returns

    value, or throw if null

    Returns ValueT

Generated using TypeDoc