Skip to content

Latest commit

 

History

History
37 lines (28 loc) · 1010 Bytes

README.md

File metadata and controls

37 lines (28 loc) · 1010 Bytes

axios-offline

npm package npm downloads License: MIT

Remembering failed requests and repeating when an internet connection is available

Install

npm install axios-offline --save

or

yarn add axios-offline

Usage

import Axios from 'axios'
import AxiosOffline from 'axios-offline'
import LocalForage from "localforage"

let AxiosOfflineAdapter = AxiosOffline({
  defaultAdapter: Axios.defaults.adapter, //require, basic adapter
  storageName: "axios-offline", //optional, default: "axios-stack"
  storageDriver: LocalForage.LOCALSTORAGE //optional, default: LocalForage.LOCALSTORAGE
})

let http = Axios.create({
  adapter: AxiosOfflineAdapter
})

export default http