Skip to content

Instantly share code, notes, and snippets.

@aduth
Created Mar 18, 2019
Embed
What would you like to do?
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