Created
September 15, 2020 00:09
Async wrapper, replacing try catch
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
/* The async wrapper, replacing try catch block */ | |
// eslint-disable-next-line no-unused-vars | |
const asyncWrapper = fn => (...args) => fn(...args).catch(args[2]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment