Proxy helpers for collections. This replaces the sort/filter functions on `Marionette.View` and the Backbone Paginator library.
npm install marionette.collectionhelperThis library is a proof-of-concept for how I see CollectionView being managed
in future versions of Marionette.
Install via NPM:
``bash`
npm install marionette.collectionhelper
You can then include it in your JS views:
`javascript
import { Filter } from 'marionette.collectionhelper';
const NameFilter = Filter.extend({
filterFunction: function(term) {
return this.where({
name: term
});
}
});
filter = new NameFilter(new Collection([{name: 'Sarah'}]));
filter.search('Sarah');
`
The [Docsite][docs] outlines how to use this library and how it works with
Marionette.
To build and test the collection helper library:
`bash`
npm i --no-progress
npm run compile
npm t
Marionette's CollectionView` has many issues regarding how it handles sorting
and filtering. For full information, see
[the Rationale document][rationale].
[docs]: http://scottwalton.codes/marionette.collectionhelper
[rationale]: http://scottwalton.codes/marionette.collectionhelper/rationale/