Skip to content

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

Description

@jokeyrhyme
  • 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?

Activity

  1. jokeyrhyme commented on Mar 5, 2015

    @jokeyrhyme
    Author

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

  2. tellnes commented on Mar 5, 2015

    @tellnes
    Contributor

    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

  3. Fishrock123 commented on Mar 5, 2015

    @Fishrock123
    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.

  4. added
    duplicateIssues and PRs that are duplicates of other issues or PRs.
    on Mar 5, 2015
  5. jokeyrhyme commented on Mar 5, 2015

    @jokeyrhyme
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateIssues and PRs that are duplicates of other issues or PRs.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions