Created
March 5, 2020 03:15
-
-
Save jwulf/443ec653fe0aee1fbf78afa332f58773 to your computer and use it in GitHub Desktop.
A code example from the article https://www.joshwulf.com/blog/2020/03/array-async-failure
This file contains hidden or 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
const { error, success } = outcomes.reduce((acc, o) => o.error ? | |
{ error: [...acc.error, o.error], success: acc.success } : | |
{ error: acc.error, success: [...acc.success, o.success] }, | |
{ error: [], success: [] }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment