Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ali322/axios-offline-adapter
offline adapter for axios
https://github.com/ali322/axios-offline-adapter
axios axios-adapter
Last synced: 17 days ago
JSON representation
offline adapter for axios
- Host: GitHub
- URL: https://github.com/ali322/axios-offline-adapter
- Owner: ali322
- Created: 2018-05-18T01:37:57.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-10-22T14:24:58.000Z (about 5 years ago)
- Last Synced: 2024-10-11T09:14:41.529Z (about 1 month ago)
- Topics: axios, axios-adapter
- Language: JavaScript
- Size: 2.93 KB
- Stars: 5
- Watchers: 3
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
axios-offline-adapter
===cache response each time, responed with cached when request in offline environment
## Install
```bash
npm i axios-offline-adapter --save
```## Usage
add adapter in your request code
```javascript
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](http://en.wikipedia.org/wiki/MIT_License)