Skip to content

Instantly share code, notes, and snippets.

@dobrakmato
Created September 22, 2017 17:26
Show Gist options
  • Save dobrakmato/95e92e77596cb069a440732ec897ee12 to your computer and use it in GitHub Desktop.
Save dobrakmato/95e92e77596cb069a440732ec897ee12 to your computer and use it in GitHub Desktop.
async function processData() {
const data = await downloadData();
}
async function processData() {
const data1 = await downloadFromService1();
const data2 = await downloadFromService2();
const data3 = await downloadFromService3();
...
}
async function processData() {
const promise1 = downloadFromService1();
const promise2 = downloadFromService2();
const promise3 = downloadFromService3();
const allResults = Promise.all([promise1, promise2, promise3])
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment