socket.io icon indicating copy to clipboard operation
socket.io copied to clipboard

[Feature] eventNames support

Open vitalics opened this issue 2 years ago • 2 comments

Is your feature request related to a problem? Please describe.

As a universal wrapper for agnostic runtime, we use emitter.eventNames(). But for socket.io this function is not implemented

Describe the solution you'd like

expose eventNames() function which returns an array of built-in events. ['error', 'ping', 'reconnect', 'reconnect_attempt', 'reconnect_error', 'reconnect_failed']

Describe alternatives you've considered None

Additional context I know that related WebAPI this field is not exposed, but it's be very helpful for wrapper libraries

vitalics avatar Feb 11 '23 12:02 vitalics

Hi! Thanks for raising this. I suppose this is for the client package.

expose eventNames() function which returns an array of built-in events

Should we include only built-in events, or all events (in order to match the behavior of the Node.js emitter)?

Source: https://github.com/socketio/emitter

darrachequesne avatar Feb 13 '23 13:02 darrachequesne

@darrachequesne Yes for the client package. I suppose that it will be very useful to support all events to simulate node.js emitter behavior.

vitalics avatar Feb 14 '23 20:02 vitalics