Skip to content

Instantly share code, notes, and snippets.

@skellock
Created February 17, 2017 22:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save skellock/ccfece63b6f4af5bd8b13d08ff4e0c59 to your computer and use it in GitHub Desktop.
Save skellock/ccfece63b6f4af5bd8b13d08ff4e0c59 to your computer and use it in GitHub Desktop.
api.post('/upload', data, {
onUploadProgress: progressEvent => {
const percentCompleted = Math.round((progressEvent.loaded * 100) / progressEvent.total)
// don't be spammy when we log
if (percentComplete % 10 === 0) {
console.tron.log(``)
}
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment