Skip to content
This repository has been archived by the owner on Jun 16, 2018. It is now read-only.

Flow Sort is not stable #46

Open
mhils opened this issue Aug 23, 2017 · 2 comments
Open

Flow Sort is not stable #46

mhils opened this issue Aug 23, 2017 · 2 comments
Labels

Comments

@mhils
Copy link
Member

mhils commented Aug 23, 2017

We currently use Array.sort in in ducks/utils/store.js, which is a bad idea because it's unstable. We should instead use _.sortBy and adjust makeSort in ducks/flows.js accordingly.

@mhils mhils added the type/bug label Aug 23, 2017
@MatthewShao
Copy link

sorry for the really late response.
_.sortBy does not accept a compare function as Array.sort does, while we are using the compare function everywhere. How about including a new dependency: stable, so that we can preserve our code structure and get the stable sorting.

@mhils
Copy link
Member Author

mhils commented Feb 1, 2018

Hm, it's a bit stupid because we go through the tedious process of creating a sorting function here only to then need to work around it. 😅
It's probably not much harder to makeSort -> makeSortKey?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants