Logos DX
    Preparing search index...

    Function retryPlugin

    • Factory function that creates a retry plugin for FetchEngine.

      The plugin installs an execute (pipe) hook at priority -20 that wraps the core request function in a retry loop with exponential backoff.

      Type Parameters

      • H = unknown
      • P = unknown
      • S = unknown

      Parameters

      • OptionaldefaultConfig: false | RetryConfig

        Default retry configuration for the engine

      Returns FetchPlugin<H, P, S>

      FetchPlugin that can be installed via engine.use() or plugins config

      const api = new FetchEngine({
      baseUrl: 'https://api.example.com',
      plugins: [
      retryPlugin({ maxAttempts: 3, baseDelay: 1000 })
      ]
      });