Created
April 20, 2018 12:51
-
-
Save hrdtbs/4ea26ef791e4a09936856b72cba00ff4 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 pararels = async promises => { | |
const objectZip = (keys, values) => | |
keys.reduce( | |
(others, key, index) => ({ | |
...others, | |
[key]: values[index] | |
}), | |
{} | |
); | |
return objectZip( | |
Object.keys(promises), | |
await Promise.all(Object.values(promises)) | |
); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment