Share your code. Components are building blocks, you are the architect.

utils/invoker
v1.1.0
1.1.0
1.0.0
MIT
PUBLIC
3
Build: fail
BuildFail
Build Status: fail
Turns a named method with a specified arity into a function that can be

Please configure Bit as a scoped registry to install components with NPM.Learn more

npm config set '@bit:registry' https://node.bitsrc.io
Use utils/invoker in your project
npm i @bit/bit.ramda.utils.invoker
Copied

invoker (arity:Number, method:String) : Function

Turns a named method with a specified arity into a function that can be called directly supplied with arguments and a target object.

The returned function is curried and accepts arity + 1 parameters where the final parameter is the target object.

Example

var sliceFrom = R.invoker(1, 'slice');
     sliceFrom(6, 'abcdefghijklm'); //=> 'ghijklm'
     var sliceFrom6 = R.invoker(2, 'slice')(6);
     sliceFrom6(8, 'abcdefghijklm'); //=> 'gh'

Arguments

arity: Number

Number of arguments the returned function should take before the target object.

method: String

Name of the method to call.

Returns

Function

A new curried function.