Created
January 7, 2018 15:44
-
-
Save ktilcu/4b227c2b2e3103aa3a73c284277ffd70 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
| const getAvatars = async (userId) => { | |
| const user = await getUser(userId); | |
| const [avatar, friends] = await Promise.all([user.avatar(), user.friends()]) | |
| const avatars = [avatar]; | |
| return avatars.concat( | |
| await Promise.all( | |
| friends.map(friend => friend.avatar()) | |
| ) | |
| ); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment