How to use the descend function from ramda
Find comprehensive JavaScript ramda.descend code examples handpicked from public code repositorys.
GitHub: dqmmpb/define-demos
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));
0
0
0
+ 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 = [
0
0
2
+ 11 other calls in file
GitHub: DPANET/PrayersHomeySDK3
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')) ]);
0
0
0
+ 7 other calls in file
ramda.clone is the most popular function in ramda (30311 examples)