Pass list items to .sort(fn) and don't set the comparator #2399

merged 2 commits into from May 19, 2016


None yet
3 participants

akagomez commented May 19, 2016

This PR does two things:

  • list.comparator('prop'); list.sort(fn) - fn will be passed the list items and not the item's prop value (#2159)
  • list.sort(fn) - fn will not be set as list.attr('comparator', fn) under the hood thus preserving the ability to call .sort() at will without setting up sorting for every "change" event (#2398)

Closes #2159, and #2398.

@akagomez akagomez added in progress and removed in progress labels May 19, 2016

@daffl daffl merged commit 874a561 into master May 19, 2016

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
continuous-integration/travis-ci/push The Travis CI build passed

@daffl daffl deleted the preserve-on-demand-sorting-2398 branch May 19, 2016

@daffl daffl added this to the 2.3.24 milestone May 19, 2016


This comment has been minimized.

Show comment
Hide comment

pYr0x commented May 19, 2016

@akagomez @daffl we should also make a PR against ?

@pYr0x pYr0x referenced this pull request in canjs/can-list-sort May 31, 2016


dont forget to implement #2399 #3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment