fat-arrow
v1.0.0
Published
Easy returns for if you don't have a () => around
Downloads
7
Maintainers
Readme
fat-arrow
Easy returns for if you don't have a () =>
around. Works well with Promises
when you have to return another value in a .then()
chain. Actually this is
just a closure-as-a-module.
Installation
$ npm install fat-arrow
Usage
const fa = require('fat-arrow')
Promise.resolve('myVal')
.then(asyncAction)
// => 'myVal'
function asyncAction(val) {
return Promise.resolve('anotherVal')
.then(fa(val))
}