Skip to content

Instantly share code, notes, and snippets.

@heapwolf
Created August 6, 2012 16:18
Show Gist options
  • Save heapwolf/3276061 to your computer and use it in GitHub Desktop.
Save heapwolf/3276061 to your computer and use it in GitHub Desktop.
emitters/implementation
var inherits = require('util').inherits;
var EventEmitter = require('events').EventEmitter;
function MyClass() {
EventEmitter.call(this);
}
inherits(MyClass, EventEmitter);
MyClass.prototype.myMethod = function() {
this.emit('myEventType', 'a', 'b');
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment