MiddlewareContext

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

API

Constructor

new MiddlewareContext(options)
Params:
ParameterTypeDescription
*options

Methods

addFetchStartListener(callback)
Params:
ParameterTypeDescription
*callback
Returns:
execute()
Returns:Promise
markResponseDecoded(response,decodedBody)
Params:
ParameterTypeDescription
*responseResponse
*decodedBodyPromise
Returns:void
notifyFetchStart(fetchPromise)
Params:
ParameterTypeDescription
*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