Skip to content

ali322/axios-offline-adapter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

axios-offline-adapter

cache response each time, responed with cached when request in offline environment

Install

npm i axios-offline-adapter --save

Usage

add adapter in your request code

import axios from 'axios'
import offlineAdapter from 'axios-offline-adapter'

const offline = offlineAdapter({
  name: 'axios-offline',
  adapter: axios.defaults.adapter
})

const http = axios.create({
  adapter: offline
})

http.get('/path/to/api').then(ret => {
  // bussiness code
})

License

MIT License

About

offline adapter for axios

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published