Method decorator: handle new connections.
The method runs when a transport (WS adapter) accepts a connection. Like every keyed handler it receives (payload, event); for connect the payload is empty, read the connection with connectionOf(event).
(payload, event)
connect
connectionOf(event)
A method decorator.
@RealtimeGateway()export class Presence { @OnConnect() onConnect (_, event) { const connection = connectionOf(event) }} Copy
@RealtimeGateway()export class Presence { @OnConnect() onConnect (_, event) { const connection = connectionOf(event) }}
Method decorator: handle new connections.
The method runs when a transport (WS adapter) accepts a connection. Like every keyed handler it receives
(payload, event); forconnectthe payload is empty, read the connection withconnectionOf(event).