documentcloud/backbone — pull request #1314 by tgriesser (2012-05-15 04:02:06+00:00)
Title: Router.remove() for dynamic removal of routes

I came across a situation in a web application i'm working on, where it made much more sense to allow routes to be dynamically added/removed from a router than to write application logic in several places determining whether the routes content should be redirected or not.

I took a quick look around and found this: https://github.com/documentcloud/backbone/issues/1272 - while I agree that URL's should be permanent in the vast majority of situations, there are some cases where they aren't (redirected unauthenticated content, for one example), and it would make more sense to allow them to pass through to a catch all unless the route exists. If a route is dynamically added, it seems to make sense that it can be dynamically removed as well.

I've made sure to include updates to the docs & test coverage as well.