Last active
January 7, 2018 17:19
-
-
Save andrIvash/98b32cbc1f5da76b0582a38e6e9b85c6 to your computer and use it in GitHub Desktop.
promise waterfall2
This file contains hidden or 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
| 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