Created
September 19, 2011 22:19
-
-
Save alassek/1227770 to your computer and use it in GitHub Desktop.
Easy multiple-inheritance in Backbone.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function () { | |
function extendEach () { | |
var args = Array.prototype.slice.call(arguments), | |
child = this; | |
_.each(args, function (proto) { | |
child = child.extend(proto); | |
}); | |
return child; | |
} | |
Backbone.Model.extendEach = | |
Backbone.Collection.extendEach = | |
Backbone.Router.extendEach = | |
Backbone.View.extendEach = extendEach; | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Actually @sroze, no.
http://backbonejs.org/docs/backbone.html#section-189