Skip to content

Instantly share code, notes, and snippets.

@fbatroni
Created December 28, 2017 01:35
Show Gist options
  • Save fbatroni/0ce8a548d2e64d45bcc00142739eca06 to your computer and use it in GitHub Desktop.
Save fbatroni/0ce8a548d2e64d45bcc00142739eca06 to your computer and use it in GitHub Desktop.
ES6 Class With Inheritance
'use strict';
const EventEmitter = require('events').EventEmitter;
const SomeClass = (() => {
class SomeClass extends SomeOtherClass {
constructor() {
super();
EventEmitter.call(this);
}
}
util.inherits(SomeClass, EventEmitter);
return SomeClass;
})();
module.exports = SomeClass;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment