@juulsgaard/signal-tools
    Preparing search index...

    Class IRequestStateAbstract

    A class representing the state of a request

    Hierarchy (View Summary)

    Implements

    • Subscribable<unknown>
    Index

    Constructors

    Properties

    error: Signal<Error | undefined>

    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<unknown>

    The underlying request

    result: Signal<unknown>

    The result of the request, or undefined when unresolved

    result$: Observable<unknown>

    The result of the request

    Methods

    • Perform an action when the request finishes (Error or Success)

      Parameters

      • onComplete: (error?: Error) => void

      Returns this

    • Subscribe to the underlying request Observable

      Parameters

      • observer: Partial<Observer<unknown>>

      Returns Unsubscribable

    • Perform actions when the request finishes

      Parameters

      • onValue: (value: unknown) => void

        Action to perform on successful resolution

      • OptionalonError: (error: Error) => void

        Action to perform on error

      Returns this