A simple, extensible state machine for your Backbone views.
bower install backbone.states
- Backbone
Include the script in your dependency list. Note that Backbone States is already included as part of Backbone APP
Then add states to your views the same way you add events:
states: {
"init": "onInit",
"postRender": "doPagination"
}
Event listeners are automatically created on initialization. When an event is triggered the assigned methods will be executed. You may manually trigger an a state in your code
this.trigger("postRender");
Created by Makis Tracend ( @tracend )
Distributed through Makesites.org
Released under the MIT license