Skip to content

Instantly share code, notes, and snippets.

@andrIvash
Last active January 7, 2018 17:19
Show Gist options
  • Select an option

  • Save andrIvash/98b32cbc1f5da76b0582a38e6e9b85c6 to your computer and use it in GitHub Desktop.

Select an option

Save andrIvash/98b32cbc1f5da76b0582a38e6e9b85c6 to your computer and use it in GitHub Desktop.
promise waterfall2
getJSON(url) // response.results - array of urls
.then(response => Promise.all(response.results.map(getJSON)))
.then(arrayOfPlanetData => arrayOfPlanetData.forEach(planet => createPlanetThumb(planet))
.catch(error => console.log(error));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment