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

utils/converge
v1.0.0
1.0.0
MIT
PUBLIC
0
1     DEPENDENCIES
Build: none
BuildNone
Accepts a converging function and a list of branching functions and returns

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/converge in your project
npm i @bit/bit.ramda.utils.converge
Copied

converge (after:Function, functions:Array) : Function

Accepts a converging function and a list of branching functions and returns a new function. When invoked, this new function is applied to some arguments, each branching function is applied to those same arguments. The results of each branching function are passed as arguments to the converging function to produce the return value.

Example

var average = R.converge(R.divide, [R.sum, R.length])
     average([1, 2, 3, 4, 5, 6, 7]) //=> 4

     var strangeConcat = R.converge(R.concat, [R.toUpper, R.toLower])
     strangeConcat("Yodel") //=> "YODELyodel"

Arguments

after: Function

A function. `after` will be invoked with the return values of `fn1` and `fn2` as its arguments.

functions: Array

A list of functions.

Returns

Function

A new function.