Created
May 30, 2017 04:49
-
-
Save velotio-tech/aed77e1987c28a7636ee07c5b5effbf4 to your computer and use it in GitHub Desktop.
NodeJS Async-Await Example
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
async fooBarBaz(arg) { | |
try { | |
const fooResponse = await foo(arg+1); | |
const barResponse = await bar(arg+2); | |
const bazResponse = await baz(arg+3); | |
return bazResponse; | |
} catch (error) { | |
return Error(error); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment