2.0.0 • Published 9 years ago

@ndhoule/invoker v2.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
9 years ago

invoker CI

Creates a function that invokes a given method.

Installation

$ component install ndhoule/invoker
$ npm install @ndhoule/invoker

API

invoker(method : Function|string) => Function(receiver, ...args)

Accepts a method name or a function, and returns a function that invokes that method on a receiver.

var map = invoker('map');
map([1, 2, 3], function(num) {
  return num + 1;
});
//=> [2, 3, 4]

License

Released under the MIT license.