0.1.0 • Published 6 months ago
@pinia/colada-plugin-retry v0.1.0
Retry failed queries or mutations with your Pinia Colada.
Installation
npm install @pinia/colada-plugin-retryUsage
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,
},
})