misoproject / dataset

JavaScript library that makes managing the data behind client-side visualisations easy
http://misoproject.com
GNU General Public License v2.0
1.18k stars 99 forks source link

ds.sort syntax is ugly #132

Closed alexgraul closed 12 years ago

alexgraul commented 12 years ago

currently to set and run a sort comparator you need to do

ds.sort( { comparator: function(a,b) {...} });

The signature could be changed to ds.sort( comparator, options ); to be a big nicer and remove the need for the extra object most of the time.

iros commented 12 years ago

Since you can set comparator on instantiation AND set ds.comparator = function(a,b), in this signature comparator is optional. As such, it goes into the optional arguments which can have silent:true. If we make it a param then it might require us passing null as first arg to set a silent:true.