Args Decorator

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

Overview

function Args(mapIndex?: number, useType?: any): any;

Description

Inject the list of arguments in the decorated parameter.

@Args accept an index parameter to pick up directly the item in the arguments list.

Example

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

  @Input("event")
  myMethod(@Args() arguments: any[]) {

  }

  @Input("event2")
  myMethod2(@Args(0) data: any) {

  }
}