Skip to content

Instantly share code, notes, and snippets.

@miguelmota
Created June 21, 2017 04:23
Show Gist options
  • Save miguelmota/a6d2a09c56dd92c9588b03e495f6eeba to your computer and use it in GitHub Desktop.
Save miguelmota/a6d2a09c56dd92c9588b03e495f6eeba to your computer and use it in GitHub Desktop.
JavaScript class extend EventEmitter
const EventEmitter = require('events')
class MyClass extends EventEmitter {
constructor() {
super() // required
this.emit('event', 100)
}
}
@iocmet
Copy link

iocmet commented Jan 3, 2022

removeListener not work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment