@ndhoule/invoker

v2.0.0
Creates a function that invokes a given method.
component

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.

npm i @ndhoule/invoker

Metadata

  • MIT
  • Whatever
  • Nathan Houle
  • released 5/2/2016

Downloads

Maintainers