Skip to content

Instantly share code, notes, and snippets.

@fengb
Created December 5, 2018 18:52
Show Gist options
  • Save fengb/8233678ebb7af552340a6a3b271c1306 to your computer and use it in GitHub Desktop.
Save fengb/8233678ebb7af552340a6a3b271c1306 to your computer and use it in GitHub Desktop.
await lodash value()
_.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