Skip to content

Wrap a set of functions in a single function that calls each

License

Notifications You must be signed in to change notification settings

bendrucker/call-all-fns

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

call-all-fns Build Status Greenkeeper badge

Wrap a set of functions in a single function that calls each

Install

$ npm install --save call-all-fns

Usage

var callAll = require('call-all-fns')

var all = callAll([
  function (value) {
    return value + 1
  },
  function (value) {
    return value + 2
  } 
])
all(1)
//=> [2, 3]

API

callAll(fns) -> function

Returns a function that will pass all arguments to the fns and then return an array of results.

fns

Required
Type: array[function] / functions...

An array of functions. Functions can also be provided as a variadic set of arguments.

License

MIT © Ben Drucker

About

Wrap a set of functions in a single function that calls each

Resources

License

Stars

Watchers

Forks

Packages

No packages published