Skip to content

Instantly share code, notes, and snippets.

@EightArmCode
Created August 27, 2018 14:29
Show Gist options
  • Save EightArmCode/1411d9fca83ab6c13ab3a46da47ad63a to your computer and use it in GitHub Desktop.
Save EightArmCode/1411d9fca83ab6c13ab3a46da47ad63a to your computer and use it in GitHub Desktop.
fakePromiseAll catches rejected promises to complete all promises and collect errors
function fakePromiseAll(arr) {
return Promise.all(arr.map(item => {
return item.then(
result => {
return result;
},
error => {
return error;
}
);
}));
}
module.exports = fakePromiseAll;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment