Options
All
  • Public
  • Public/Protected
  • All
Menu

Module fetch/fetchJsonapiEndpoint

Index

Functions

Functions

Const default

  • default(apiUrl: string, requestInit?: {}, onError?: (err: Error) => void, res?: boolean | ServerResponse<IncomingMessage>, fetch?: fetchAdapter): Promise<void | Response>
  • fetch data from a JSON:API endpoint

    Parameters

    • apiUrl: string

      the api url for the JSON:API endpoint

    • requestInit: {} = {}

      fetch initialization object

    • onError: (err: Error) => void = ...

      custom error handler defaults to throw error

        • (err: Error): void
        • Parameters

          • err: Error

          Returns void

    • Optional res: boolean | ServerResponse<IncomingMessage>

      response object

    • fetch: fetchAdapter = ...

      fetch compatible function

    Returns Promise<void | Response>

    a promise containing the data for the JSON:API response

Generated using TypeDoc