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

added removeAllListeners #111

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

vdikun
Copy link

@vdikun vdikun commented Jan 9, 2019

No description provided.

@jdegger
Copy link
Collaborator

jdegger commented Oct 27, 2020

Thank you for your PR and our apologies it has been quiet on this PR for so long. Please read #158 for a general update on what's happening in this repo.


This PR seems like a good addition to the current function stack. Could you edit the readme in this PR as well?

Comment on lines +117 to +119
_eventHandlers[type].forEach(value => {
value.remove()
})
Copy link
Collaborator

Choose a reason for hiding this comment

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

the foreach introduces a race condition here where removeAllListeners might return before all event handlers are removed.

Converting it to a traditional for-loop or returning a resolved promise when done will resolve this issue.

@jdegger
Copy link
Collaborator

jdegger commented Nov 10, 2020

@benminer this PR is alsmost finished but requires a docs update, are you willing to create a new PR with this PR included + the readme change?

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.

None yet

2 participants