# Decorator InputAndBroadcastOthers

Decorator
Module
import { InputAndBroadcastOthers } from "@tsed/socketio"
Source/packages/socketio/src/decorators/inputAndBroadcastOthers.ts

# Overview

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

# Description

Attach the decorated method to the socket event and broadcast the response to all clients with the exception of the connected customer.

# Example

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

  @InputAndBroadcastOthers("event")
  async myMethod(@Args(0) data: any, @Nsp socket) {
     return {data: "data"};
  }
}
1
2
3
4
5
6
7
8

Other topics