Stone.js API
    Preparing search index...
    • 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).

      Parameters

      • channel: string

        The channel to listen on.

      • event: string

        The event name to handle.

      Returns MethodDecorator

      A method decorator.

      @RealtimeGateway()
      export class Chat {
      @OnEvent('room:1', 'message') onMessage (payload, event) { ... }
      }