Created
December 5, 2018 18:52
-
-
Save fengb/8233678ebb7af552340a6a3b271c1306 to your computer and use it in GitHub Desktop.
await lodash value()
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
_.prototype.then = function(...args) { return Promise.resolve(this.value()).then(...args) } | |
/* | |
async function convert(array) { | |
const converted = await _.chain(array) | |
.filter(x => x % 2) | |
.map(x => x * 2) | |
} | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment