Skip to content

Instantly share code, notes, and snippets.

View marksoper's full-sized avatar

Mark Soper marksoper

View GitHub Profile
@marksoper
marksoper / gist:4531770
Last active December 11, 2015 02:38
Extension of Backbone.Router so that the router can function as a simple state machine while retaining normal Backbone Router characteristics
//
// StateRouter
//
// An example of an extended version of Backbone.Router
// that implements a simple state machine
// without altering the router's ability to function as a normal Backbone.Router
// states can be normal Backbone routes that function as intended
// states can also be non-route states that can't be routed into
// they're transitioned into using the transitionTo method
//