AniLink - v3.0.0
    Preparing search index...

    Type Alias OnResponseHandler

    OnResponseHandler: (
        context: RequestContext & {
            cacheHit?: boolean;
            cacheWrite?: boolean;
            durationMs: number;
            pacedMs?: number;
            rateLimit?: RateLimitInfo;
        },
    ) => void

    A callback invoked after each attempt completes with the elapsed durationMs and parsed rateLimit headers when present. When the response was served from the opt-in response cache, cacheHit is true and durationMs is 0; when a cacheable read was served from the network after a cache miss, cacheHit is false. Responses unrelated to the cache (mutations, cache-less clients) carry no cacheHit at all. When the request waited for rate-limit pacing before dispatch, pacedMs carries the total time spent waiting across the request's attempts, cumulative, so on a retried request it can exceed the final attempt's durationMs (which measures only that attempt); requests that never waited carry no pacedMs at all.

    Type Declaration

      • (
            context: RequestContext & {
                cacheHit?: boolean;
                cacheWrite?: boolean;
                durationMs: number;
                pacedMs?: number;
                rateLimit?: RateLimitInfo;
            },
        ): void
      • Parameters

        • context: RequestContext & {
              cacheHit?: boolean;
              cacheWrite?: boolean;
              durationMs: number;
              pacedMs?: number;
              rateLimit?: RateLimitInfo;
          }

        Returns void