Socket Decorator

Module
import { Socket } from "@tsed/socketio"
Source/packages/socketio/src/decorators/socket.ts

Overview

function Socket(target: any, propertyKey: string, index: number): any;

Description

Inject the Socket instance in the decorated parameter.

Example

@SocketService("/nsp")
export class MyWS {

  @Input("event")
  myMethod(@Socket socket) {

  }
}