Created
December 28, 2017 01:35
-
-
Save fbatroni/0ce8a548d2e64d45bcc00142739eca06 to your computer and use it in GitHub Desktop.
ES6 Class With Inheritance
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
'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