Skip to content

Instantly share code, notes, and snippets.

@velotiotech
Created July 1, 2020 11:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save velotiotech/62039fc18c379459d1d0be08177a1043 to your computer and use it in GitHub Desktop.
Save velotiotech/62039fc18c379459d1d0be08177a1043 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