Lead Maintainer: Clemens Stolle
A mixin for extending ampersand-collection with a bunch of lodash methods.
If you're using an ampersand-rest-collection this is already mixed in for you.
Out of the box, ampersand-collections proxy the ES5 iteration methods already so you don't have to use this mixin, but if you want lodash methods, or better browser support, you can use this.
This mixin adds the following lodash methods:
countBy, difference, drop, each, every, filter, find, findWhere, first, forEach, groupBy, includes, indexOf, initial, invoke, invokeMap, isEmpty, keyBy, last, lastIndexOf, map, max, min, partition, pluck, reduce, reduceRight, reject, sample, shuffle, size, some, sortBy, take, tail, where, without
It weighs in at about
npm install ampersand-collection-lodash-mixin
var Collection = ;var lodashMixin = ;moduleexports = Collection;
All credit for underscore and this approach in backbone goes to Jeremy Ashkenas and the rest of the Backbone and Underscore authors. All credit for lodash goes to John-David Dalton.
Big thanks to @STRML who generously gave us this module name on npm. If you're interested in his version, it's still there public, you can just keep using version