Skip to content

IO

@tsed/socketio

Usage

typescript
import { IO } from "@tsed/socketio";

See /packages/third-parties/socketio/src/types/decorators/io.ts.

Overview

ts
function IO(): (...args: any[]) => any;
export function IO(target: Type<any>, targetKey: string | symbol | undefined, descriptor: TypedPropertyDescriptor<Function> | number): any;

Description

Inject the SocketIO.Server instance in the decorated parameter.

Example

typescript
@SocketService("/nsp")
export class MyWS {
  constructor(@IO private io: Server) {}
}

Released under the MIT License.