Last active
September 2, 2017 01:22
-
-
Save patmigliaccio/0a24580a7c09a8ae996e38cf0f9dc834 to your computer and use it in GitHub Desktop.
patmigliaccio.com/async-fishing 12/11/16
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
var a = () => Promise.resolve(1); | |
var b = () => Promise.reject(new Error(2)); | |
var c = () => Promise.resolve(3); | |
Promise.all([a(), b(), c()].map(p => p.catch(e => e))) | |
.then(results => console.log(results)) // 1,Error: 2,3 | |
.catch(e => console.log(e)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment