Created
September 27, 2012 16:59
-
-
Save fivetanley/3795115 to your computer and use it in GitHub Desktop.
framework maybe?
This file contains hidden or 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
define( function( require ) { | |
var framework = require( 'framework' ) | |
, prototype | |
prototype = { | |
// self is always passed as the last argument to make functions re-usable | |
// and remove confusing `this` semantics | |
constructor: function( options, self ) { | |
self.model = options.model | |
} | |
, eventHandler: function( eventData, self ) { | |
self.model.changeState() | |
} | |
} | |
// if this is a viewmodel, we could do some magic to get jQuery | |
// methods like $.hide(), so new instances would have their own | |
// useful methods, for free. | |
return framework.wrap( prototype ) | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment