Created
June 8, 2013 02:44
-
-
Save mbajoras/5733773 to your computer and use it in GitHub Desktop.
Backbone.js model for my blog article about Marionette.js stateful views.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class @ALoginModel extends Backbone.Model | |
defaults: -> | |
username: '' | |
password: '' | |
state: @notAuthState # This is where you set the initial state. | |
stateDetails: '' | |
# Define constants to represent the various states and give them descriptive | |
# values to help with debugging. | |
notAuthState: 'Not Authenticated' | |
pendingAuthState: 'Pending Authentication' | |
authSuccessState: 'Authentication Success' | |
authFailState: 'Authentication Failure' | |
authUnknownState: 'Authentication Unknown' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment