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

utils/sort-with
v1.0.0
1.0.0
MIT
PUBLIC
0
1     DEPENDENCIES
Build: none
BuildNone
Sorts a list according to a list of comparators.

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

sortWith (functions:Array, list:Array) : Array

Sorts a list according to a list of comparators.

Example

var alice = {
       name: 'alice',
       age: 40
     };
     var bob = {
       name: 'bob',
       age: 30
     };
     var clara = {
       name: 'clara',
       age: 40
     };
     var people = [clara, bob, alice];
     var ageNameSort = R.sortWith([
       R.descend(R.prop('age')),
       R.ascend(R.prop('name'))
     ]);
     ageNameSort(people); //=> [alice, clara, bob]

Arguments

functions: Array

A list of comparator functions.

list: Array

The list to sort.

Returns

Array

A new list sorted according to the comarator functions.