Skip to content

yoshuawuyts/fat-arrow

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fat-arrow

NPM version build status Test coverage Downloads js-standard-style

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))
}

License

MIT

About

Easy returns for if you don't have a () => around

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published