-
-
Save aduth/f464f2d549a80716127a7e0d575b102f 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 globalListener() { | |
const errors = listeners.reduce( ( result, listener ) => { | |
try { | |
listener(); | |
} catch ( error ) { | |
result.push( error ); | |
} | |
return result; | |
}, [] ); | |
errors.forEach( ( error ) => { | |
throw error; | |
} ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment