kinetex - v1.0.0-rc.1
    Preparing search index...

    Function createTimeoutInterceptor

    • Create a timeout interceptor that aborts requests exceeding the configured deadline. Cleans up timers in both the response and error phases.

      Parameters

      • config: Partial<TimeoutConfig> = {}

        Timeout configuration (defaults used for omitted fields)

      Returns {
          id: string;
          requestInterceptor: RequestInterceptorFn;
          responseInterceptor: ResponseInterceptorFn;
          errorInterceptor: ErrorInterceptorFn;
      }

      • id: string

        Identifier for this timeout interceptor instance

      • requestInterceptor: RequestInterceptorFn

        Attaches an AbortSignal to the request with the configured timeout

      • responseInterceptor: ResponseInterceptorFn

        Cleans up the timeout timer after a successful response

      • errorInterceptor: ErrorInterceptorFn

        Cleans up the timeout timer when an error occurs