Created
March 28, 2019 02:33
-
-
Save ruliarmando/7f5b49063e44180d114dc9ecc654ef8d to your computer and use it in GitHub Desktop.
Like Promise.all but with object (must use lodash)
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
Promise.allValues = async (object) => { | |
return _.zipObject(_.keys(object), await Promise.all(_.values(object))) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment