Hacker News new | ask | show | jobs
by dchuk 4987 days ago
I'm very much a noob when it comes to Backbone, but isn't the states you described a use case for the built in router already included in Backbone?
2 comments

You could use Backbone's routes to manage top-level app states if there is a 1:1 mapping between states and routes, your app's states are relatively simple, and you don't need any special handling of transitions. As bmelton describes, that case is not as common or obvious as one might think.

In general, I'd always encourage any non-trivial app to treat states and routes/history separately.

That's treating the application as if it were completely stateless, and mucks with browser history. A good example of when to use state vs. a route is on a delete. If I route to a delete, for example, then it might fire again when I hit my 'back' button, which is obviously a bad idea.

Derick Bailey has a good article on it here: http://lostechies.com/derickbailey/2011/08/03/stop-using-bac...

awesome, thanks!