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

feature request: EventEmitter#off() alias for EventEmitter#removeListener() #1064

Closed
jokeyrhyme opened this issue Mar 5, 2015 · 4 comments
Closed
Labels
duplicate Issues and PRs that are duplicates of other issues or PRs.

Comments

@jokeyrhyme
Copy link

  • makes the API more symmetrical: we already have an EventEmitter#on() alias for EventEmitter#addListener()
  • Wolfy87/EventEmitter has #off()
  • Backbone.js has #off()
  • this seems to be a fairly common pattern of convenience elsewhere in the ecosystem

Is this the sort of thing you'd welcome a PR for? Or is this not something you're interested having in core?

@jokeyrhyme
Copy link
Author

Cross-posted with Node.js: nodejs/node-v0.x-archive#9332

@tellnes
Copy link
Contributor

tellnes commented Mar 5, 2015

Here is some references. There is probably a few more that I've forgotten.
#540
nodejs/node-v0.x-archive#3338
nodejs/node-v0.x-archive#5352

@Fishrock123
Copy link
Contributor

From #540

And off is weird. event listeners aren't light switches. "on" has a number of meanings, "off" is the opposite of only some of those meanings. "under" is also an antonym of "on"... but neither "under" nor "off" are antonyms of the meaning of "on" used by EE.

@Fishrock123 Fishrock123 added the duplicate Issues and PRs that are duplicates of other issues or PRs. label Mar 5, 2015
@jokeyrhyme
Copy link
Author

Sorry about the duplicate. I swear I did search first. /shrug
Arguments against this make sense. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate Issues and PRs that are duplicates of other issues or PRs.
Projects
None yet
Development

No branches or pull requests

3 participants