Method decorator: handle a specific event on a specific channel.
Receives (payload, event) when the named event arrives on the channel; the connection is connectionOf(event).
(payload, event)
connectionOf(event)
The channel to listen on.
The event name to handle.
A method decorator.
@RealtimeGateway()export class Chat { @OnEvent('room:1', 'message') onMessage (payload, event) { ... }} Copy
@RealtimeGateway()export class Chat { @OnEvent('room:1', 'message') onMessage (payload, event) { ... }}
Method decorator: handle a specific event on a specific channel.
Receives
(payload, event)when the named event arrives on the channel; the connection isconnectionOf(event).