* Adds a listener that will be fired when any event is received. The event name is passed as the first argument to * the callback. * * @example * io.on("connection", (socket) => { * socket.onAny((event, ...args) => { * console.log(`got event ${event}`); * }); * });
(listener: (...args: any[]) => void)
| 1041 | * @param listener |
| 1042 | */ |
| 1043 | public onAny(listener: (...args: any[]) => void): this { |
| 1044 | this._anyListeners = this._anyListeners || []; |
| 1045 | this._anyListeners.push(listener); |
| 1046 | return this; |
| 1047 | } |
| 1048 | |
| 1049 | /** |
| 1050 | * Adds a listener that will be fired when any event is received. The event name is passed as the first argument to |