Created
April 30, 2019 06:28
-
-
Save kartikpandey2/979d6e7659d9401a595f94d9114e1ea2 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
const multipleFetch = async () => { | |
const Fetch1 = await fetch(url, options) | |
/* | |
* Fetch1 has completed, Do required things after fetch1 | |
*/ | |
const Fetch2 = await fetch(url, options) | |
/* | |
* Fetch1 and Fetch2 has completed, Do required things after fetch2 | |
*/ | |
const Fetch3 = await fetch(url, options) | |
/* | |
* Fetch1,Fetch2 and Fetch3 has completed, Do required things after fetch3 | |
*/ | |
const Fetch4 = await fetch(url, options) | |
/* | |
* Fetch1, Fetch2, Fetch3 and Fetch4 has completed, Do required things after fetch4 | |
*/ | |
} | |
const performanceFetch = async () => { | |
const urlArray = ["url1", "url2", "url3", "url4", "url5",] | |
const promiseArray = urlArray.map((url) => fetch(url)) | |
const arrayOfResponse = await Promise.all(promiseArray) | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment