Class ApiResponseHandler

The default HandlesApiResponse implementation used by upfrontjs.

Link

Hierarchy

  • ApiResponseHandler

Implements

Constructors

Methods

  • Handle the promised response.

    Returns

    Parameters

    • promise: Promise<ApiResponse<null | string | any[] | Record<string, any>> & { request: { method: "head" | "HEAD" } }>

    Returns Promise<undefined | Omit<ApiResponse<null | string | any[] | Record<string, any>>, "data" | "json">>

  • Type Parameters

    Type Parameters

    • T

    Parameters

    Returns Promise<undefined | T>

  • Handle errors that occurred during the promise execution.

    Returns

    Parameters

    • rejectReason: unknown

    Returns Promise<unknown>

  • Handle successful request.

    Returns

    Throws

    Parameters

    • response: ApiResponse<null | string | any[] | Record<string, any>> & { request: { method: "head" | "HEAD" } }

    Returns Promise<undefined | Omit<ApiResponse<null | string | any[] | Record<string, any>>, "data" | "json">>

  • Type Parameters

    Type Parameters

    • T

    Parameters

    Returns Promise<undefined | T>

Generated using TypeDoc