@byu-oit/nuxt-axios-backoff
v1.0.1
Published
Nuxt plugin that facilitates an axios retry backoff
Downloads
40
Readme
Setup
Install
Install with yarn:
yarn add @byu-oit/nuxt-axios-backoffInstall with npm:
npm install @byu-oit/nuxt-axios-backoffnuxt.config.js
module.exports = {
modules: [
'@nuxt/axios',
'@byu-oit/nuxt-axios-backoff',
],
}Typescript
Add the types to your "types" array in tsconfig.json after the @nuxt/types (Nuxt 2.12.0+)
tsconfig.json
{
"compilerOptions": {
"types": [
"@nuxt/types",
"@nuxtjs/axios",
"@byu-oit/nuxt-axios-backoff"
]
}
}Why?
Because of the way nuxt works the
$axiosproperty on the context has to be merged into the nuxtContextinterface via declaration merging. Adding@byu-oit/nuxt-axios-backoffto your types will import the types from the package and make typescript aware of the additions to theContextinterface.
Usage
TODO
