# BroadcastOthers Decorator
Module | import { BroadcastOthers } from "@tsed/socketio" |
---|---|
Source | /packages/socketio/src/decorators/broadcastOthers.ts |
# Overview
function BroadcastOthers(eventName: string): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => void;
# Description
Broadcast the response for all client registered in the same namespace except to the current client.
With the @BroadcastOthers
decorator, the method will accept a return type (Promise or not).
# Example
@SocketService("/nsp")
export class MyWS {
@Input("event")
@BroadcastOthers("returnEvent")
async myMethod(@Args(0) data: any, @Nsp socket): Promise<any> {
return Promise.resolve({data})
}
}
1
2
3
4
5
6
7
8
9
2
3
4
5
6
7
8
9
- Session & cookies
- Passport.js
- TypeORM
- Mongoose
- GraphQL
- Socket.io
- Swagger
- AJV
- Multer
- Serve static files
- Templating
- Throw HTTP Exceptions
- Customize 404
- AWS
- Jest
- Seq
- Controllers
- Providers
- Model
- Converters
- Middlewares
- Pipes
- Interceptors
- Authentication
- Hooks
- Injection scopes
- Custom providers
- Custom endpoint decorator
- Testing