cache response each time, responed with cached when request in offline environment
npm i @velliz/axios-offline-adapter localforage --save
yarn add @velliz/axios-offline-adapter localforage
add adapter in your request code
import axios from 'axios'
import offlineAdapter from '@velliz/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
})