Last active
January 9, 2019 23:23
-
-
Save tjjfvi/c1427e2ee24bc75a48c31ae31075222d to your computer and use it in GitHub Desktop.
Promise.allObjectValues(obj): Creates a Promise that awaits & returns al values of obj
This file contains 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
Promise.allObjectValues = async obj => | |
Object.assign({}, ...(await Promise.all(Object.entries(obj).map(async ([k, v]) => ({ [k]: await v }))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment