Skip to content

Instantly share code, notes, and snippets.

@antondevv
Created February 15, 2022 18:42
Show Gist options
  • Save antondevv/43752b3a5be71da91be643800288dfbd to your computer and use it in GitHub Desktop.
Save antondevv/43752b3a5be71da91be643800288dfbd to your computer and use it in GitHub Desktop.
Promise chain
const myPromises = urls.map((url) => fetch(url).then((res) => res.json()));
Promise.all(myPromises).then((data) => {
// When all requests have finished
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment