JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 473
  • Score
    100M100P100Q108146F
  • License MIT

Retry failed requests with Pinia Colada

Package Exports

  • @pinia/colada-plugin-retry

Readme

Pinia Colada logo Pinia Colada Retry

npm package

Retry failed queries or mutations with your Pinia Colada.

Installation

npm install @pinia/colada-plugin-retry

Usage

import { PiniaColadaRetry } from '@pinia/colada-plugin-retry'

// Pass the plugin to Pinia Colada options
app.use(PiniaColada, {
  // ...
  plugins: [
    PiniaColadaRetry({
      // Pinia Colada Retry options
    }),
  ],
})

You can customize the retry behavior individually for each query/mutation with the retry option:

useQuery({
  key: ['todos'],
  query: getTodos,
  retry: {
    // Number of retries, can also be a function
    retry: 3,
    // Delay between retries, can also be a function
    delay: 1000,
  },
})

License

MIT