Skip to content

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 ParameterDefault type
Tany

Parameters ​

ParameterTypeDescription
eventDataTThe event data.
roomContextParsedRoomThe parsed room information.

Returns ​

boolean | Promise<boolean>

True if the event should be emitted to this room.