Skip to content

Instantly share code, notes, and snippets.

@velotio-tech
Created May 30, 2017 04:49
Show Gist options
  • Save velotio-tech/aed77e1987c28a7636ee07c5b5effbf4 to your computer and use it in GitHub Desktop.
Save velotio-tech/aed77e1987c28a7636ee07c5b5effbf4 to your computer and use it in GitHub Desktop.
NodeJS Async-Await Example
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