Skip to main content

BuildFetchOptions

Index

Properties

optionalcoerce

coerce?: (promise: Promise<Response>) => Promise<Response>

Type declaration

    • (promise: Promise<Response>): Promise<Response>
    • Gives consumers an opportunity to manipulate the Promise object before handing it over to downstream for further processing.

      One use case is in Ember distribution whereas the fetch needs to return a RSVP.Promise instance instead of the native promise.


      Parameters

      • promise: Promise<Response>

      Returns Promise<Response>

optionaldebug

debug?: boolean

Whether to enable debug mode. This is useful for debugging through the middleware stack. The default value is true buildFetch will add a $debug property on the fetch function that is returned with helpful debug information.

optionaldisableMessage

disableMessage?: string

What message to throw if a user tries to invoke a disabled fetch. Useful to help users know where to import fetch from rather than build it // themselves.

optionaldisablePrior

disablePrior?: boolean

Whether to force earlier built fetches to error making the most recent // invokation the authoritive fetch. You will typically only want to set this to false for testing. Defaults to true.

optionalfetch

fetch?: (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>

Type declaration

    • (input: RequestInfo | URL, init?: RequestInit): Promise<Response>
    • override the default fetch implementation


      Parameters

      • input: RequestInfo | URL
      • optionalinit: RequestInit

      Returns Promise<Response>