Crashlytics Labs announces the release of Backbone.StateManager
1–10 of 16 posts
Re: Crashlytics Labs announces the release of Backbone.StateManager
#2Re: Crashlytics Labs announces the release of Backbone.StateManager
#3Could someone give a practical example of a use case for this? This is probably useful for some typical problems in Backbone applications but not something I knew I would need (having built a couple of non-trivial Backbone apps).
Re: Crashlytics Labs announces the release of Backbone.StateManager
#4Could someone give a practical example of a use case for this? This is probably useful for some typical problems in Backbone applications but not something I knew I would need (having built a couple of non-trivial Backbone apps).
You could think of it as an abstraction of the Router mechanism.
Re: Crashlytics Labs announces the release of Backbone.StateManager
#5Could someone give a practical example of a use case for this? This is probably useful for some typical problems in Backbone applications but not something I knew I would need (having built a couple of non-trivial Backbone apps).
You could think of it as an abstraction of the Router mechanism.
Re: Crashlytics Labs announces the release of Backbone.StateManager
#6Could someone give a practical example of a use case for this? This is probably useful for some typical problems in Backbone applications but not something I knew I would need (having built a couple of non-trivial Backbone apps).
Re: Crashlytics Labs announces the release of Backbone.StateManager
#7Could someone give a practical example of a use case for this? This is probably useful for some typical problems in Backbone applications but not something I knew I would need (having built a couple of non-trivial Backbone apps).
Re: Crashlytics Labs announces the release of Backbone.StateManager
#8Could someone give a practical example of a use case for this? This is probably useful for some typical problems in Backbone applications but not something I knew I would need (having built a couple of non-trivial Backbone apps).
- list of folders
- contents of a given folder
- contents of a thread
- contents of a message
- compose message
- profile settings
- ...
In a typical MVC app, the 'enter' method of each state would set up the appropriate models, views and controllers, and the 'exit' method would do the corresponding teardown / cleanup. You could tie this to the history API (or history.js) to support URL linking and navigation.
But states can mean anything you want as long as only one of them can be active at any time in a given context (StateManager). In a Vim implementation you could manage the normal / insert / visual editing modes using States. In a space shooter game, you could have the player spaceship be in normal, shielded, dead, etc states.
The link to Backbone is extremely thin and basically limited to using Backbone's event system to trigger state change events.
Re: Crashlytics Labs announces the release of Backbone.StateManager
#9Could someone give a practical example of a use case for this? This is probably useful for some typical problems in Backbone applications but not something I knew I would need (having built a couple of non-trivial Backbone apps).
Re: Crashlytics Labs announces the release of Backbone.StateManager
#10Could someone give a practical example of a use case for this? This is probably useful for some typical problems in Backbone applications but not something I knew I would need (having built a couple of non-trivial Backbone apps).
Useful to manage parts of your application (or the whole thing) as state machines. For example, a simple email app might have top-level states such as: - list of folders - contents of a given folder - contents of a thread - contents of a message - compose message - profile settings - ... In a typical MVC app, the 'enter' method of each state would set up the appropriate models, views and controllers, and the 'exit' m…