Retry failed requests with Pinia Colada
npm install @pinia/colada-plugin-retryRetry failed queries or mutations with your Pinia Colada.
``sh`
npm install @pinia/colada-plugin-retry
`js
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:
`ts``
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,
},
})