Skip to content

Instantly share code, notes, and snippets.

@arbaaz
Created November 19, 2014 20:15
Show Gist options
  • Save arbaaz/ac531691506ea88d0123 to your computer and use it in GitHub Desktop.
Save arbaaz/ac531691506ea88d0123 to your computer and use it in GitHub Desktop.
backbone render optimised
render: function() {
this.$el.empty();
var container = document.createDocumentFragment();
// render each subview, appending to our root element
_.each(this._views, function(subview) {
container.appendChild(subview.render().el);
});
this.$el.append(container);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment