-
Notifications
You must be signed in to change notification settings - Fork 27
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
Consistent sorting functions #59
Comments
subcollection is being deprecated, see AmpersandJS/ampersand-subcollection#43 This doesn't change this issue, just where you should be looking as we go forward filtered-subcollection sortBy line is here https://github.com/AmpersandJS/ampersand-filtered-subcollection/blob/master/ampersand-filtered-subcollection.js#L259 |
What are your thoughts for a revision? Modifying the APIs to both use the same sort function seems to make the most sense, but I could be missing something, in which case documentation clarity would be great. I can go ahead and make the change and put a PR in whichever way seems to make sense. |
I'd definitely want to hear from other @AmpersandJS/core-team members, but at first glance it seems to me the code in ampersand-collection is a rough version of what's in underscore/amp/lodash sortBy and we should switch to the latter so we are using an abstraction that's being independently maintained and tested. |
Seems to make sense. |
ampersand-subcollection and ampersand-collection both use different sort methods.
Ampersand-subcollection uses lodash sortBy, and ampersand-collection uses native array sort. I ran into an issue where I was using the wrong sort method.
Not sure what the best change to make is, but maybe editing docs to make it more clear that collection/sub-collection have different APIs or normalizing the API to use the same sort method.
https://github.com/AmpersandJS/ampersand-subcollection/blob/master/ampersand-subcollection.js#L175
https://github.com/AmpersandJS/ampersand-collection/blob/master/ampersand-collection.js#L238
The text was updated successfully, but these errors were encountered: