SudoSOS Back-end API / service/websocket/event-guards / EventGuard
Type Alias: EventGuard()<T> ​
ts
type EventGuard<T> = (eventData, roomContext) => boolean | Promise<boolean>;Guard function that determines if an event should be emitted to a room.
Type Parameters ​
| Type Parameter | Default type |
|---|---|
T | any |
Parameters ​
| Parameter | Type | Description |
|---|---|---|
eventData | T | The event data. |
roomContext | ParsedRoom | The parsed room information. |
Returns ​
boolean | Promise<boolean>
True if the event should be emitted to this room.