Created
June 11, 2019 03:18
-
-
Save copperwall/6a3890e915d6925a24478d15ee220179 to your computer and use it in GitHub Desktop.
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 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