Skip to content

Remembering failed requests and repeating when an internet connection is available

License

Notifications You must be signed in to change notification settings

jonkofee/axios-offline

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Remembering failed requests and repeating when an internet connection is available

Resources

License

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published