Class SupplyIsOff<TResult>

An indicator of supply cut off.

Indicates why the supply has been cut off (i.e. due to failure or successful completion), and when this happened.

Type Parameters

  • out TResult = void

    Supply result type.

Hierarchy

Constructors

  • Constructs an indicator.

    Type Parameters

    • out TResult = void

    Parameters

    • Rest ...init: undefined extends TResult
          ? [init?: Init<TResult>]
          : [init: Init<TResult>]

      Initialization parameters. Successful supply completion indicator

    Returns SupplyIsOff<TResult>

  • Constructs an indicator derived from the base one.

    Constructed indicator will indicate cut off happened at the same time as the base one.

    Type Parameters

    • out TResult = void

    Parameters

    • base: SupplyIsOff<TResult>

      Base indicator to derive from.

    • init: AnyInit<TResult>

      Initialization parameters overriding corresponding values from the base indicator.

    Returns SupplyIsOff<TResult>

Accessors

  • get error(): unknown
  • An error indicating supply failure reason.

    Contains value only when failed flag is true. Contains undefined value otherwise.

    Returns unknown

  • get failed(): boolean
  • Whether the supply has failed.

    When true, the error property contains a failure reason.

    Returns boolean

  • get isOff(): this
  • A reference to itself.

    Use to detect a supply cut off indicator.

    Returns this

  • get result(): undefined | TResult
  • A result of successfully completed supply.

    Contains value only when failed flag is false. Contains undefined otherwise.

    Returns undefined | TResult

Methods

  • Whether indicated cut off happened at the same time as another one.

    The supplies depending on the one cut off initially, considered cut off at the same time.

    Parameters

    • another: SupplyIsOff<unknown>

      Another cut off indicator.

    Returns boolean

  • Creates a supply cut off reason indicator caused by the given reason.

    • If the reason is an indicator already, just returns it.
    • Otherwise, if the reason is undefined, then creates new successful supply cut off indicator.
    • Otherwise, creates new failed supply cut off indicator, and uses the reason as supply failure error.

    Type Parameters

    • TReason

    • TResult = void

    Parameters

    • this: void
    • Rest ...__namedParameters: ReasonArgs<TResult, TReason>

    Returns SupplyIsOff<TResult>

    Supply cut off indicator cause by reason.

  • Creates indicator of faultily terminates supply.

    When error is a supply failure indicator, then returns this supply. Otherwise, it is used as an error value.

    Parameters

    • this: void
    • Optional error: unknown

      Supply failure reason.

    Returns Faultily

    Failure indicator

  • Creates indicator of successfully completed supply.

    Type Parameters

    • TResult = void

    Parameters

    • this: void
    • result: TResult

      Supply result.

    Returns Successfully<TResult>

    Success indicator.

Generated using TypeDoc