Created
March 21, 2012 23:06
-
-
Save kaiquewdev/2154003 to your computer and use it in GitHub Desktop.
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
| var Event = (function () { | |
| var Event = function Event() {}; | |
| Event.prototype._target; | |
| Event.prototype.set = function set( value ) { | |
| value = value || ''; | |
| if ( value ) { | |
| _target = value; | |
| } | |
| return this; | |
| }; | |
| Event.prototype.get = function get() { | |
| return _target; | |
| }; | |
| return new Event(); | |
| } ()); | |
| var event = Event; | |
| event.set('Hello skitter'); | |
| console.log(event.get()); | |
| console.log(Event.set('Boy').get()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment