mixin EventEmitter

master
Aaron Heckmann 12 years ago
parent c9ace7e8ef
commit c94b1076cd
  1. 11
      index.js

@ -5,6 +5,7 @@
*/
var Stream = require('stream').Stream;
var EventEmitter = require('events').EventEmitter;
/**
* Constructor.
@ -21,6 +22,8 @@ function gm (source, height, color) {
return new gm(source, height, color);
}
EventEmitter.call(this);
this._options = {};
this.options(this.__proto__._options);
@ -65,6 +68,14 @@ function gm (source, height, color) {
});
}
/**
* Mixin EventEmitter
*/
for (var method in EventEmitter.prototype) {
gm.prototype[method] = EventEmitter.prototype[method];
}
var parent = gm;
gm.subClass = function subClass (options) {
function gm (source, height, color) {

Loading…
Cancel
Save