Skip to content

Instantly share code, notes, and snippets.

@radfahrer
Created July 6, 2018 20:38
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 radfahrer/9cf31c8aed2171d93fc43a4bf4f3f6b9 to your computer and use it in GitHub Desktop.
Save radfahrer/9cf31c8aed2171d93fc43a4bf4f3f6b9 to your computer and use it in GitHub Desktop.
/* 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