<commit_before># Backbone Support [![Build Status](https://travis-ci.org/thoughtbot/backbone-support.png?branch=master)](https://travis-ci.org/thoughtbot/backbone-support) [![Gem Version](https://badge.fury.io/rb/backbone-support.png)](https://rubygems.org/gems/backbone-support)

## No Longer Maintained

This project is no longer being actively maintained. If you're interested in
taking over this project, please get in touch. You can reach us by emailing
[<EMAIL>](mailto:<EMAIL>) or by contacting
[@thoughtbot on Twitter](https://twitter.com/thoughtbot).

## Summary

Backbone Support provides a collection of utility classes for use with
[Backbone.js][]. There's no built-in garbage collection for Backbone’s event
bindings, and forgetting to unbind can cause bugs and memory leaks. Backbone
Support has you covered.

Backbone Support provides two utility classes, SwappingRouter and
CompositeView, which are extensions of Backbone's standard View and Router
objects. They provide methods that simplify creating and managing nested views
and automate the cleanup of events when switching between views.

Inspired by our projects and the [Backbone.js on Rails book][].

The book contains complete instructions and in-depth coverage of the internals
of CompositeView and SwappingRouter, and an example application that shows
their usage.

### SwappingRouter

A Router subclass the provides a standard way to swap one view for another.

This introduces a convention that all views have a `leave()` function,
responsible for unbinding and cleaning up the view. And the convention that
all actions underneath the same `Router` share the same root element, and<commit_msg>Remove "No Longer Maintained" message<commit_after># Backbone Support [![Build Status](https://travis-ci.org/thoughtbot/backbone-support.png?branch=master)](https://travis-ci.org/thoughtbot/backbone-support) [![Gem Version](https://badge.fury.io/rb/backbone-support.png)](https://rubygems.org/gems/backbone-support)

## Summary

Backbone Support provides a collection of utility classes for use with
[Backbone.js][]. There's no built-in garbage collection for Backbone’s event
bindings, and forgetting to unbind can cause bugs and memory leaks. Backbone
Support has you covered.

Backbone Support provides two utility classes, SwappingRouter and
CompositeView, which are extensions of Backbone's standard View and Router
objects. They provide methods that simplify creating and managing nested views
and automate the cleanup of events when switching between views.

Inspired by our projects and the [Backbone.js on Rails book][].

The book contains complete instructions and in-depth coverage of the internals
of CompositeView and SwappingRouter, and an example application that shows
their usage.

### SwappingRouter

A Router subclass the provides a standard way to swap one view for another.

This introduces a convention that all views have a `leave()` function,
responsible for unbinding and cleaning up the view. And the convention that
all actions underneath the same `Router` share the same root element, and
{'fraction_non_alphanumeric': 0.07253886010362694, 'fraction_numerical': 0.0, 'mean_word_length': 5.369072164948453, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 9, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3536863', 'n_tokens_mistral': 812, 'n_tokens_neox': 779, 'n_words': 371}