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

utils/ascend
v1.1.0
1.1.0
1.0.0
MIT
PUBLIC
3
1     DEPENDENCIES
Build: fail
BuildFail
Build Status: fail
Makes an ascending comparator function out of a function that returns a value

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

ascend (fn:Function, a:*, b:*) : Number

Makes an ascending comparator function out of a function that returns a value that can be compared with < and >.

Example

var byAge = R.ascend(R.prop('age'));
     var people = [
       // ...
     ];
     var peopleByYoungestFirst = R.sort(byAge, people);

Arguments

fn: Function

A function of arity one that returns a value that can be compared

a: *

The first item to be compared.

b: *

The second item to be compared.

Returns

Number

`-1` if fn(a) < fn(b), `1` if fn(b) < fn(a), otherwise `0`