Skip to content

Instantly share code, notes, and snippets.

@miguelmota
Created June 21, 2017 04:23
Show Gist options
  • Select an option

  • Save miguelmota/a6d2a09c56dd92c9588b03e495f6eeba to your computer and use it in GitHub Desktop.

Select an option

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)
}
}
@kadiryumlu
Copy link
Copy Markdown

Thanks.

@iocmet
Copy link
Copy Markdown

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