axios-progressfy
v1.1.8
Published
axios-progressfy is a javascript module that adds an additional method called "onprogress" to the promises returned by axios get, post, put and delete methods. This additional method allows you to subscribe to the upload and download progress of data pass
Downloads
7
Maintainers
Readme
axios-progressfy
axios-progressfy is a javascript module that adds an additional method called "onprogress" to the promises returned by axios get, post, put and delete methods. This additional method allows you to subscribe to the upload and download progress of data passed to those methods.
Install
npm install axios-progressfy
Usage
import _axios from 'axios';
import progressfy from 'axios-progressfy';
const axios = progressfy(_axios);
axios.get('http://example/products/1')
.then((response)=> console.log(response))
.catch((error)=> console.log(error))
.onprogress((progress)=> console.log(progress));
/*
progress = {
id,
data,
error,
response,
isUploading,
uploaded,
isDownloading,
downloaded
}
*/
Related modules
- redux-progressfy - redux middleware to handle progress.