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

utils/descend
v1.1.0
1.1.0
1.0.0
MIT
PUBLIC
3
1     DEPENDENCIES
Build: fail
BuildFail
Build Status: fail
Makes a descending 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/descend in your project
npm i @bit/bit.ramda.utils.descend
Copied

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

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

Example

var byAge = R.descend(R.prop('age'));
     var people = [
       // ...
     ];
     var peopleByOldestFirst = 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`