Skip to content

Instantly share code, notes, and snippets.

@copperwall
Created June 11, 2019 03:18
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 copperwall/6a3890e915d6925a24478d15ee220179 to your computer and use it in GitHub Desktop.
Save copperwall/6a3890e915d6925a24478d15ee220179 to your computer and use it in GitHub Desktop.
async function doStuff() {
const partyProfileRes = fetch('/v1/users');
const accountRes = fetch('/v1/customers');
const [partyProfile, account] = await Promise.all([
partyProfileRes,
accountRes
]);
try {
// Need to await for try catch to work!
const payment = await fetch('v1/payment');
} catch (e) {
errorLogger('uh oh', e.message);
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment