Skip to content

Add on/off to EventSignal? #37399

Open
Open
@ronag

Description

@ronag

Would if make sense to add on/off as aliases to addEventListener/removeEventListener?

I'm ending up writing quite a bit of code that checks for either since usually I like to implement api's to support both EventEmitter and AbortSignal. Having the aliases would make code much easier and less error prone.

Metadata

Metadata

Assignees

No one assigned

    Labels

    docIssues and PRs related to the documentations.eventsIssues and PRs related to the events subsystem / EventEmitter.eventtargetIssues and PRs related to the EventTarget implementation.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions