A manually populated RequestState

Type Parameters

  • T

Hierarchy (view full)

Constructors

Properties

cancelled: Signal<boolean> = ...

Emits true when the RequestState has been cancelled by a consumer, otherwise emits false

cancelled$: Observable<true> = ...

Emits true when the RequestState has been cancelled by a consumer

error: Signal<undefined | Error> = ...

Emits the error if one is thrown by the request. Otherwise undefined

failed: Signal<boolean> = ...

Emits true if the request failed

loading: Signal<boolean> = ...

Emits true when the request is running

request$: Observable<T> = ...

The underlying request

result: Signal<undefined | T> = ...

The result of the request, or undefined when unresolved

result$: Observable<T> = ...

The result of the request

Accessors

Methods

  • Perform actions when the request finishes

    Parameters

    • onValue: ((value: T) => void)

      Action to perform on successful resolution

        • (value): void
        • Parameters

          • value: T

          Returns void

    • OptionalonError: ((error: Error) => void)

      Action to perform on error

        • (error): void
        • Parameters

          • error: Error

          Returns void

    Returns this