You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If compareFunction(a, b) returns 0, leave a and b unchanged with respect to each other, but sorted with respect to all different elements. Note: the ECMAscript standard does not guarantee this behaviour, and thus not all browsers (e.g. Mozilla versions dating back to at least 2003) respect this.
So I'm not so sure about return 0. I can create a PR for my suggested fix it should be fairly low impact.
results:
['state1','state2','state3']
['state3', 'state2', 'state1']
Models will get sorted in reverse order when the comparator attribute is undefined on a model.
This result can be replicated in chrome and firefox but not phantom js.
This works correctly in
Backbone.Collection
as it uses the underscoresortBy
method and notArray.prototype.sort
.Swapping these two lines https://github.com/AmpersandJS/ampersand-collection/blob/v1.3.17/ampersand-collection.js#L227-228 (and https://github.com/AmpersandJS/ampersand-collection/blob/v1.3.17/ampersand-collection.js#L235-236) seems to do the trick for chrome and firefox but breaks phantom js.
The text was updated successfully, but these errors were encountered: