feat(emit): added feature to interrupt emit by zgover · Pull Request #276 · EventEmitter2/EventEmitter2 · GitHub
Skip to content

feat(emit): added feature to interrupt emit - #276

Open
zgover wants to merge 1 commit into
EventEmitter2:masterfrom
zgover:patch-1
Open

zgover wants to merge 1 commit into
EventEmitter2:masterfrom
zgover:patch-1

Conversation

@zgover

@zgover zgover commented Aug 14, 2021

Copy link
Copy Markdown

Added feature to interrupt the currently running synchronous emit process.

  • replaces existing and outdated pull-request Allow listeners to stop an event's propagation #127
  • returning EventEmitter.macro.SIGINT constant from the handler prevents other listeners of the same event from being called
  • calling this.stopImmediatePropagation() inside the handler prevents other listeners of the same event from being called

@RangerMauve

Copy link
Copy Markdown
Contributor

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants