Created
November 28, 2013 00:50
-
-
Save tgvashworth/7685685 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 events = require('events'); | |
undefined | |
> var ee = new events.EventEmitter(); | |
undefined | |
> var thing1 = Object.create(ee); | |
undefined | |
> var thing2 = Object.create(ee); | |
undefined | |
> thing1.on('fish', console.log.bind(console, 'thing1')); | |
{} | |
> thing2.emit('fish', 'hello from thing2'); | |
thing1 hello from thing2 | |
true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment