How to use the descend function from ramda

Find comprehensive JavaScript ramda.descend code examples handpicked from public code repositorys.

397
398
399
400
401
402
403
404
405
406
  name: 'clara',
  age: 40
}
var people = [clara, bob, alice];
var ageNameSort = R.sortWith([
  R.descend(R.prop('age')),
  R.ascend(R.prop('name'))
])
log(ageNameSort(people));

fork icon0
star icon0
watch icon0

+ 9 other calls in file

1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
* @sig Ord b => (a -> b) -> a -> a -> Number
* @param {Function} fn A function of arity one that returns a value that can be compared
* @param {*} a The first item to be compared.
* @param {*} b The second item to be compared.
* @return {Number} `-1` if fn(a) < fn(b), `1` if fn(b) < fn(a), otherwise `0`
* @see R.descend
* @example
*
*      const byAge = R.ascend(R.prop('age'));
*      const people = [
fork icon0
star icon0
watch icon2

+ 11 other calls in file

173
174
175
176
177
178
179
180
181
182
    prayerAfterBefore: DurationAfterBefore.Before,
    prayerDurationType: DurationTypes.Seconds,
    upcomingPrayerTime: getPrayerTime
});
let sortWith = ramda.sortWith([
    ramda.descend(ramda.prop('prayerName')),
    ramda.descend(ramda.prop('prayerAfterBefore')),
    ramda.descend(ramda.prop('prayerDurationType')),
    ramda.descend(ramda.prop('prayerDurationTime'))
]);
fork icon0
star icon0
watch icon0

+ 7 other calls in file

Other functions in ramda

Sorted by popularity

function icon

ramda.clone is the most popular function in ramda (30311 examples)