Permalink
Browse files

Chain can now be called directly on underscore

  • Loading branch information...
1 parent 9550bec commit a93ed0443f2a2a1d5d7af8c0f8672285c54275ca @tgriesser tgriesser committed Jan 2, 2013
Showing with 1 addition and 8 deletions.
  1. +1 −8 backbone.js
View
9 backbone.js
@@ -846,13 +846,6 @@
return new this.constructor(this.models);
},
- // Proxy to _'s chain. Can't be proxied the same way the rest of the
- // underscore methods are proxied because it relies on the underscore
- // constructor.
- chain: function() {
- return _(this.models).chain();
- },
-
// Reset all internal state. Called when the collection is reset.
_reset: function() {
this.length = 0;
@@ -901,7 +894,7 @@
'reject', 'every', 'all', 'some', 'any', 'include', 'contains', 'invoke',
'max', 'min', 'sortedIndex', 'toArray', 'size', 'first', 'head', 'take',
'initial', 'rest', 'tail', 'drop', 'last', 'without', 'indexOf', 'shuffle',
- 'lastIndexOf', 'isEmpty'];
+ 'lastIndexOf', 'isEmpty', 'chain'];
// Mix in each Underscore method as a proxy to `Collection#models`.
_.each(methods, function(method) {

2 comments on commit a93ed04

@braddunbar
Collaborator

Wonderful stuff.

@akre54
Collaborator

👍

Please sign in to comment.