Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support custom sort method for object keys #323

Open
janryWang opened this issue Jan 30, 2021 · 2 comments
Open

support custom sort method for object keys #323

janryWang opened this issue Jan 30, 2021 · 2 comments

Comments

@janryWang
Copy link

Currently there is only one sortKeys property to control automatic sorting, but I hope it can be specified manually

@mac-s-g
Copy link
Owner

mac-s-g commented Feb 3, 2021

@janryWang can you give an example of how you want to be able to sort differently?

@chad-autry
Copy link

I have a similar requirement for my usage, not yet high priority, but I expect I'll get around to it eventually.

In my case I have a named set of 'states' (think board game phases of a turn) which I'd like consistently ordered.

I expect if I need to develop things myself, I'd pass in an array of strings as a new parameter 'customSortOrder'. If a key is in the array, it gets sorted according to its array position, else it gets placed behind fields which appear in the array.

From my current experience playing with the codebase I don't expect it'd be too hard, if someone wanted to get their toes wet with it.

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

No branches or pull requests

3 participants