interface FetchTransformOptions {
    request: (
        ...args: FetchParameters,
    ) => FetchParameters | Promise<FetchParameters>;
    response: (response: Response) => Response | Promise<Response>;
}

Properties

Properties

request: (
    ...args: FetchParameters,
) => FetchParameters | Promise<FetchParameters>

Transforms the request options before a request is made. This executes after all of the default parameters have been configured, and is stateless. It is safe to return new request options objects.

Type declaration

response: (response: Response) => Response | Promise<Response>

Transforms the response after a request completes. This executes immediately after the request completes, and is stateless. It is safe to return a new response object.

Type declaration

    • (response: Response): Response | Promise<Response>
    • Parameters

      • response: Response

        The response object.

      Returns Response | Promise<Response>

      The transformed response object.