Created
July 6, 2018 20:38
-
-
Save radfahrer/9cf31c8aed2171d93fc43a4bf4f3f6b9 to your computer and use it in GitHub Desktop.
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
/* promises */ | |
doSomething() | |
.then(doSomethingElse) | |
.catch(handleError); | |
/* await */ | |
let result; | |
try { | |
result = await doSomething(); | |
} catch (error) { | |
handleError(error); | |
} | |
doSomethingElse(result); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment