Skip to main content

Class: SocketEventHandler

Defined in: socket/index.ts:33

Class to handle Socket Events such as connecting and disconnecting from rooms.

Extended by

Constructors

Constructor

new SocketEventHandler(
room,
eventName,
source,
payload): SocketEventHandler;

Defined in: socket/index.ts:55

Parameters

ParameterTypeDescription
roomRoomThe Room where the event is happening
eventNamestringThe name of the event
sourceUserThe User associated with the event
payloadIKeyValueThe input values of the event

Returns

SocketEventHandler

Properties

PropertyModifierTypeDescriptionDefined in
eventNameprotectedstringThe event name of a socket eventsocket/index.ts:35
inputprotectedIKeyValueThe input of the socket eventsocket/index.ts:41
outputprotectedSocketIOContextOutputThe output of the socket eventsocket/index.ts:38
roomprotectedRoomThe room where the event is occurringsocket/index.ts:44
sourceprotectedUserThe user associated with the eventsocket/index.ts:47

Methods

passthru()

protected passthru(): Promise<void>;

Defined in: socket/index.ts:66

Event to Trigger a sendToRooms event.

Returns

Promise<void>


process()

protected process(): Promise<void>;

Defined in: socket/index.ts:81

A method to process data/information. Should be overridden in subclasses.

Returns

Promise<void>


result()

result(): Promise<SocketIOContextOutput>;

Defined in: socket/index.ts:86

The output produced from this.process

Returns

Promise<SocketIOContextOutput>