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

utils/comparator
v1.1.0
1.1.0
1.0.0
MIT
PUBLIC
3
1     DEPENDENCIES
Build: fail
BuildFail
Build Status: fail
Makes a comparator function out of a function that reports whether the first

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

comparator (pred:Function) : Function

Makes a comparator function out of a function that reports whether the first element is less than the second.

Example

var byAge = R.comparator((a, b) => a.age < b.age);
     var people = [
       // ...
     ];
     var peopleByIncreasingAge = R.sort(byAge, people);

Argument

pred: Function

A predicate function of arity two which will return `true` if the first argument is less than the second, `false` otherwise

Returns

Function

A Function :: a -> b -> Int that returns `-1` if a < b, `1` if b < a, otherwise `0`