Created
January 25, 2016 19:20
-
-
Save AmrAbdulrahman/b2dfe716123155c7bae5 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
function uploadFile(data) { | |
// we can send notification one or more time as following: | |
defer.notify(percentageUploaded); | |
// returns promise | |
} | |
uploadFile() | |
.then(function() { | |
// fine | |
}, function() { | |
// error | |
}, function(percenatage) { | |
// get updates before resolving or rejecting the promise | |
console.log('Uploaded ' + percenatage + '% ...'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment