Ramda sortBy

js:

var data = [
 {id: 10, name: 'user-10'},
 {id: 10, name: 'user-10-dupe'},
 {id: 15, name: 'w-user-15'},
 {id: 20, name: 'user-20'},
];

var dataUpd = R.pipe(
  R.sortBy(R.prop('name')),
)(data);

alert( JSON.stringify(dataUpd) );

Result:

Leave a Comment