Logos DX
    Preparing search index...

    Interface FetchLifecycle<H, P, S>

    Lifecycle hooks for the FetchEngine request pipeline.

    beforeRequest hooks run before the network request. They can modify the URL/options via ctx.args(), short-circuit with a cached response via ctx.returns(), or abort with ctx.fail().

    afterRequest hooks run after a successful response. They can replace the response via ctx.returns() or abort with ctx.fail().

    interface FetchLifecycle<H = unknown, P = unknown, S = unknown> {
        afterRequest(
            response: FetchResponse,
            url: URL,
            opts: InternalReqOptions<H, P, S>,
        ): FetchResponse;
        beforeRequest(url: URL, opts: InternalReqOptions<H, P, S>): FetchResponse;
        execute(
            opts: InternalReqOptions<H, P, S>,
        ): Promise<
            FetchResponse<
                any,
                FetchEngine.InstanceHeaders,
                FetchEngine.InstanceParams,
                FetchEngine.InstanceResponseHeaders,
            >,
        >;
    }

    Type Parameters

    • H = unknown

      Headers type

    • P = unknown

      Params type

    • S = unknown

      State type

    Index

    Methods