@ndhoule/invoker
v2.0.0
Published
Creates a function that invokes a given method.
Downloads
6
Readme
invoker
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.