Skip to content

Instantly share code, notes, and snippets.

@mbajoras
Created June 8, 2013 02:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mbajoras/5733773 to your computer and use it in GitHub Desktop.
Save mbajoras/5733773 to your computer and use it in GitHub Desktop.
Backbone.js model for my blog article about Marionette.js stateful views.
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