Input Decorator

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

Overview

function Input(eventName: string): (target: any, propertyKey: string, descriptor: PropertyDescriptor) =>; void;

Description

Attach the decorated method to the socket event.

Example

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

  @Input("event")
  myMethod(@Args(0) data: any, @Nsp socket) {

  }
}
1
2
3
4
5
6
7
8