-
-
Notifications
You must be signed in to change notification settings - Fork 35.7k
Expose setMaxListeners property on AbortSignalΒ #54758
Copy link
Copy link
Closed
Labels
feature requestIssues that request new features to be added to Node.js.Issues that request new features to be added to Node.js.staleweb-standardsIssues and PRs related to Web APIsIssues and PRs related to Web APIs
Metadata
Metadata
Assignees
Labels
feature requestIssues that request new features to be added to Node.js.Issues that request new features to be added to Node.js.staleweb-standardsIssues and PRs related to Web APIsIssues and PRs related to Web APIs
Type
Fields
Give feedbackNo fields configured for issues without a type.
Projects
Status
Awaiting Triage
What is the problem this feature will solve?
Right now, there is no stable way to change the
maxEventTargetListenersof anAbortSignalwithout importing fromnode:events.This makes it impossible to write isomorphic library code that adds more than the default 10 event listeners, without having to resort to workarounds such as
This relies on the
events.maxEventTargetListenerssymbol description, which, to my knowledge is not part of any public API and could change at any time.What is the feature you are proposing to solve the problem?
Add a
AbortSignal.setMaxListenersinstance method so isomorphic code could do something likeWhat alternatives have you considered?
Alternatively, if this is not an option as it could pollute a spec-defined object with additional properties, use
Symbol.forinstead ofnew SymbolforkMaxEventTargetListenersand make that a part of the official api.I would be willing to implement this feature.