<commit_before># backbone.blazer
A better router for Backbone and Marionette applications

# Legal Schtuff (MIT License)
Any contributions made to this project are covered under the MIT Licence.<commit_msg>Build out a little more detail of what this library provides in the Readme<commit_after># backbone.blazer
A better router for Backbone and Marionette applications

## huh? what's this?
In order to build a modularized routing system, we've extended and overriden a few parts of the core `Backbone.Router`. This library attempts to be a **mostly** drop-in replacement for the normal Backbone router. However, we have removed a few things.

### what's in the box?
#### removed
We've removed the triggering of events on the router when processing a route. These were never useful to us, and so we've gotten rid of them.

#### added
`Backbone.Blazer.Router` still supports the usual way of routing in a Backbone application: mapping a regexp to a callback. However, we've gone ahead and added a new way of configuring your routes: `Backbone.Blazer.Route`.


# Router Configuration
Blazer's router supports all the familiar configuration of `Backbone.Router`
```js
var MyRouter = Backbone.Blazer.Router.extend({
  routes: {
    'regular-old-route': function(routeData) {
      // do whatever you want
    }
  }
});
```

In addition to the **old** way of routing, Blazer provides a new strategy.
```js
var MyRouter = Backbone.Blazer.Router.extend({
  routes: {
    'new-hot-route': new HotRoute()
  }
});

var HotRoute = Backbone.Blazer.Route.extend({
  execute: function(routeData) {
    // the code that would normally go in your router callback can now go here
  }
});
```

Now, that's not all that interesting really. What is interesting is that Blazer Route objects can be configured to perform asynchronous actions **before** rendering your views (or really before calling your `execute` method).

For example, here's a route that loads some data from some Backbone Model before rendering a view:

```js
var LoadSomeDataRoute = Backbone.Blazer.Route.extend({
  prepare: function(routeData) {
    this.someData = new SomeData();
    return this.someData.fetch();
  },
  execute: function(routeData) {
    App.getRegion('main').show(new SomeDataView({ model: this.someData }));
  }
});
```

# Legal Schtuff (MIT License)
Any contributions made to this project are covered under the MIT Licence.
{'fraction_non_alphanumeric': 0.09011264080100125, 'fraction_numerical': 0.0, 'mean_word_length': 4.364653243847875, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, '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': '2904652', 'n_tokens_mistral': 679, 'n_tokens_neox': 642, 'n_words': 300}