Created
July 24, 2018 14:15
-
-
Save shana/46b64998f8e3b91f3622cbf4c1479592 to your computer and use it in GitHub Desktop.
await promise without try/catch
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 [data, err] = await new Promise((resolve, reject) => | |
doSomething(resolve, reject) | |
) | |
.then(data => [data, undefined]) | |
.catch(e => [undefined, e]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment