Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
An Extension for Backbone.js Views which adds a view hierarchy, propagates the removal of a view to all its subviews, makes it easy to clean up views with all their child views and adds option to easily replace views with properly cleaning the replaced views and all its children
JavaScript
tag: v1.0rc2

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
test
README.md
backbone.subviews.js

README.md


Backbone.subviews

A Backbone.js extension for managing more complex view hierarchies and helping avoiding creation of memory leaks when dealing with persistent or long living models and collections, jQuery plugins or detached views.


author: Tomasz Tunik
version: 1.0rc2
compatibility: Backbone 0.9.2

Backbone.subviews by extending the Backbone.View class makes it easier to manage more complex view hierarchies. Apart of storing view hierarchy references with views keeping references to all its subviews and to its parents Backbone.subviews also propagates the remove of a view down the view hierarchy tree and, if defined, calls the onRemove method on all the view's subviews making it easy to clean up all the references to jQuery plugins, persistent models and collections or make any extra teardown operations.

todo

  1. add example app

changelog

1.0rc2

  • Cleaned up test dependencies
  • Tested against 0.9.2
  • Improved measuring leaks with persistent models and collections

1.0rc1

  • Initial release
  • Tested against 0.9.1
Something went wrong with that request. Please try again.