Skip to content

@lelantos-org/sdk / services / StatusHook

Type Alias: StatusHook ​

ts
type StatusHook = (res, url, init) => Promise<Response | null>;

Defined in: @lelantos-org/sdk/dist/services/http/client.d.ts:48

Handles a response with a particular status before it becomes an error.

Returns a replacement Response (whose own status is then honoured) or null to fall through to the error path. Runs at most once per attempt: the replacement is not passed back to the hook.

Parameters ​

ParameterType
resResponse
urlstring
initRequestInit | undefined

Returns ​

Promise<Response | null>