Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support disposing of EventEmitters #2517

Merged
merged 2 commits into from Oct 27, 2019

Conversation

revanthmahesh
Copy link
Contributor

@revanthmahesh revanthmahesh commented Oct 26, 2019

dispose function to clear all the listener references at once.

Fixes #2509

@revanthmahesh revanthmahesh force-pushed the dispose-eventemitters branch 3 times, most recently from 4aea36f to b732cd8 Compare October 26, 2019 10:42
@@ -7,6 +7,7 @@ import { IDisposable } from 'common/Types';

interface IListener<T> {
(e: T): void;
(): void;
Copy link
Member

Choose a reason for hiding this comment

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

Why was this added?

Copy link
Member

Choose a reason for hiding this comment

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

This is probably the cause of the build failure

Copy link
Contributor Author

Choose a reason for hiding this comment

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

IListener is allowing only a function with at least one param. It is not allowing Array.prototype.clear. In vs code it is handled by type LinkedList.

@revanthmahesh revanthmahesh force-pushed the dispose-eventemitters branch 3 times, most recently from ff444ab to c5cdc03 Compare October 27, 2019 04:35
Copy link
Member

@Tyriar Tyriar left a comment

Choose a reason for hiding this comment

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

Thanks @revanthmahesh 👍

@Tyriar Tyriar added this to the 4.3.0 milestone Oct 27, 2019
@Tyriar Tyriar merged commit 719fa55 into xtermjs:master Oct 27, 2019
@revanthmahesh revanthmahesh deleted the dispose-eventemitters branch October 27, 2019 04:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support disposing of EventEmitters
2 participants