@pinia/colada-plugin-retry
v0.0.2
Published
Retry failed requests with Pinia Colada
Downloads
184
Maintainers
Readme
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,
},
})