Last active
May 5, 2017 22:51
-
-
Save coltpini/4792a3ebee7ff75b90fe3049b54b36c9 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
Promise.All( [somePromise, anotherPromise, andAFinalPromise] ).then( values => { | |
//values is an array with the resolves from each of the promises. | |
}).catch( (err) => { | |
// if one of the promises rejects, the whole fails. | |
}); | |
Promise.race( [somePromise, anotherPromise, andAFinalPromise] ).then ( value => { | |
// value is a single value from the promise that resolved or rejected first. | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment