help mixing in or inheriting from a base prototype using EventEmitter

14 views
Skip to first unread message

Gallagher Polyn

unread,
May 1, 2015, 4:57:20 PM5/1/15
to nod...@googlegroups.com
Hi,

Given this...

function App(config) {
  EventEmitter.call(this);
  this.config = config;
}

App.prototype = Object.create(EventEmitter.prototype);

App.prototype.whatever = function() {
  // whatever
};

How can I mixin or inherit from App, say in Bapp...

function Bapp() {
  // ???
}

...such that instances of Bapp enjoy full use of App's methods, for example, "whatever()"? My efforts so far, have caused conflict with unimplemented EventEmitter methods on Bapp.

Thanks,

G
Reply all
Reply to author
Forward
0 new messages