question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Is your feature request related to a problem? Please describe.

Sorts the list according to the supplied path

Describe the solution you’d like

const sortByFirstItem = R.sortByPath([[0]]);
const pairs = [[-1, 1], [-2, 2], [-3, 3]];
sortByFirstItem(pairs); //=> [[-3, 3], [-2, 2], [-1, 1]]

const sortByAddress = R.sortByPath([['address', 'street'], ['address', 'streetNo']]);
const alice = {
  name: 'ALICE',
  age: 101,
  address: {
    street: "Czech street",
    street: 31,
  },
};
const bob = {
  name: 'Bob',
  age: -10,
  address: {
    street: "Slovak street",
    street: 32,
  },
};
const clara = {
  name: 'clara',
  age: 314.159,
  address: {
    street: "Polish street",
    street: 33,
  },
};
const people = [clara, bob, alice];
sortByAddress(people); //=> [alice, clara, bob]

Describe alternatives you’ve considered


Additional context

Original issue: https://github.com/char0n/ramda-adjunct/issues/945

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
char0ncommented, Mar 7, 2020

@Mxchaeltrxn good point. I’ve modified the issue description to reflect your comment.

1reaction
char0ncommented, Feb 28, 2020

@Mxchaeltrxn I’ve assigned it to you. But first let’s focus on https://github.com/char0n/ramda-adjunct/pull/1323. There is still lot of work to be done there. After we’re finished there, you’ll already know how submit another PR. Thanks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

sortbypath - Gun Dog Supply
ON SALE NOW! Garmin SPORT PRO · ORANGE Sylmar Body Guard Vest · 1-800-251-6133. GUN DOG SUPPLY 17645 U.S. Highway 82
Read more >
sortByProp and sortByPath and orderByProp and orderByPath
I'm inclined to wonder, would you be interested in a set of functions (similar to lodash's sortBy and orderBy) which could sort an...
Read more >
com.sun.xml.ws.transport.http.client.CookieManager.sortByPath java ...
Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence. Date (java.sql). A class which can...
Read more >
module package - github.com/hpapaxen/glicense/module - Go ...
String returns a human readable string format. type SortByPath ¶. type SortByPath []Module. SortByPath implements sort.Interface to sort a slice of Module ...
Read more >
ContentMappingInfo (IBM WebSphere Portal Version 8.5.0.0 ...
String scope, boolean sortByPath) Returns the individual content mappings assigned to this resource for a given content mapping scope.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found