Skip to content

fix: Emitter should not extend EventEmitter - #387

Merged
lance merged 2 commits into
mainfrom
lance/385-fix-emitter
Feb 28, 2021
Merged

lance merged 2 commits into
mainfrom
lance/385-fix-emitter

Conversation

@lance

@lance lance commented Feb 25, 2021

Copy link
Copy Markdown
Member

This change modifies Emitter so that it does not directly extend the Node.js
EventEmitter class. Instead, it holds a singleton instance of an EventEmitter
but is not an instance of EventEmitter itself.

This commit also updates the typescript example to use a modern version of
@types/node and typescript.

Finally there are a few minor formatting changes picked up by eslint.

@loopingz if you have a chance to review this, that would be great. Thanks!

Fixes: #385

Signed-off-by: Lance Ball lball@redhat.com

This change modifies Emitter so that it does not directly extend the Node.js
EventEmitter class. Instead, it holds a singleton instance of an EventEmitter
but is not an instance of EventEmitter itself.

This commit also updates the typescript example to use a modern version of
@types/node and typescript.

Finally there are a few minor formatting changes picked up by eslint.

Fixes: #385

Signed-off-by: Lance Ball <lball@redhat.com>
@lance lance added type/fix A change that fixes something that is broken module/lib Related to the main source code version/4.x Issues related to the 4.0 release of this library labels Feb 25, 2021
@lance
lance requested a review from a team February 25, 2021 15:03
@lance lance self-assigned this Feb 25, 2021

@loopingz loopingz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A part from the 2 small comments, it looks good to me.

Thanks

Comment thread src/transport/emitter.ts Resolved
Comment thread src/transport/emitter.ts Resolved
Signed-off-by: Lance Ball <lball@redhat.com>
@lance
lance merged commit b006b90 into main Feb 28, 2021
@lance
lance deleted the lance/385-fix-emitter branch February 28, 2021 00:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

module/lib Related to the main source code type/fix A change that fixes something that is broken version/4.x Issues related to the 4.0 release of this library

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Class static side 'typeof Emitter' incorrectly extends base class static side 'typeof EventEmitter'

4 participants