# SocketSession Decorator

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

# Overview

type SocketSession = Map<string, any>;
function SocketSession(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(@SocketSession session: Map) {
    console.log(session);
  }
}
1
2
3
4
5
6
7
8