MiddlewareContext

Source
import { MiddlewareContext } from "@prestojs/rest";
MiddlewareContext<T>

API

Constructor

new MiddlewareContext(options)

Arguments:

ArgumentTypeDescription
*options

Methods

addFetchStartListener(callback)

Arguments:

ArgumentTypeDescription
*callback
Returns:
execute()
markResponseDecoded(response,decodedBody)

Arguments:

ArgumentTypeDescription
*responseResponse
*decodedBodyPromise
Returns:void
notifyFetchStart(fetchPromise)

Arguments:

ArgumentTypeDescription
*fetchPromisePromise
Returns:void

Properties

executeOptions

Source
An object with these properties:
PropertyTypeDescription
...any
Any properties from ExecuteInitOptions
...any
Any properties from UrlResolveOptions

lastState

Source
null|
An object with these properties:
PropertyTypeDescription
*decodedBodyany
*responseResponse
*resultT
*urlstring

requestInit

Source
An object with these properties:
PropertyTypeDescription
*headersHeaders
*methodstring
...any
Any properties from RequestInit except for these:
  • headers
  • method