Skip to content

Instantly share code, notes, and snippets.

@sorensen
Created November 13, 2013 20:08
Show Gist options
  • Save sorensen/7455508 to your computer and use it in GitHub Desktop.
Save sorensen/7455508 to your computer and use it in GitHub Desktop.
Backbone constructor override.
;['View'
, 'Model'
, 'Collection'
, 'Router'
].forEach(function(klass) {
var original = Backbone[klass]
Backbone[klass] = original.extend({
constructor: function() {
// Custom logic here...
return original.apply(this, arguments);
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment