Created
January 30, 2019 02:47
-
-
Save fazlurr/e033aca2fa44cfc216b659fd0fcb7a7a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let config = { | |
onUploadProgress: progressEvent => { | |
let percentCompleted = Math.floor((progressEvent.loaded * 100) / progressEvent.total); | |
// do whatever you like with the percentage complete | |
// maybe dispatch an action that will update a progress bar or something | |
} | |
} | |
axios.post('/path/to/post/', data, config) | |
.then(response => console.log(response)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment