Created
August 31, 2013 04:34
-
-
Save jcblw/6396231 to your computer and use it in GitHub Desktop.
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
var Test = Marrow( function Test ( options ) { | |
this.options = options; | |
},{ | |
trigger: function ( ) { | |
this.emit( 'testEvent' ); | |
} | |
}), | |
Listener = Marrow( function Listener ( ) { } ), | |
listener = new Listener( ); | |
listener.on( Test, 'testEvent', function ( ) { | |
console.log( 'testEvent fired' ); | |
}); | |
var test = new Test( ), | |
test2 = new Test( ); | |
test.trigger( ); | |
test2.trigger( ); | |
// should console log 'testEvent fired' twice |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment