Created
March 29, 2017 16:00
-
-
Save montogeek/086e33c846fdcef0cd9aa42ac608605c to your computer and use it in GitHub Desktop.
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
async function getUsersData(regionCode) { | |
const promiseArray = getUsersIdList(regionCode).map(fetchUserData); | |
return Promise.all(promiseArray); | |
} | |
async function getPostsData(regionCode) { | |
const usersData = await getUsersData(regionCode); | |
const promiseArray = usersData | |
.map(getPostsIds) | |
.reduce((a, b) => a.concat(b)) | |
.map(fetchPostData); | |
return Promise.all(promiseArray); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment