Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface PerformFetchProps<T>

Type parameters

  • T

Hierarchy

  • PerformFetchProps

Index

Properties

abortSignal

abortSignal: AbortSignal

Abort signal

Optional body

body: Record<string, unknown>

The body of the fetch request.

Optional credentials

credentials: RequestCredentials

Optionally set the request's credentials

headers

headers: Headers

Fetch headers

method

method: FetchMethod

The fetch method to use

onAbort

onAbort: () => void

Callback function when the fetch request is aborted

Type declaration

    • (): void
    • Returns void

onReject

onReject: (reason: Error, additionalData?: { response?: Response }) => void

Callback function invoked when the fetch operation is rejected or fails.

see

/src/errors Different types of errors and typeguards that can be used to resolve the error

param

An error object. Utilise the error type guards to decipher what error has occured.

param

Provides additional data about the error that has occured

Type declaration

    • (reason: Error, additionalData?: { response?: Response }): void
    • Parameters

      • reason: Error
      • Optional additionalData: { response?: Response }
        • Optional response?: Response

      Returns void

onResolve

onResolve: (responseBody: T) => void

Callback function invoked when the fetch operation is resolved successfully.

param

The data returned from the fetch operation.

Type declaration

    • (responseBody: T): void
    • Parameters

      • responseBody: T

      Returns void

url

url: RequestInfo

The URL to perform the fetch operation.

Generated using TypeDoc