Skip to content
Roomful is in public beta — install with the @beta tag. Share feedback →

Interface: EventEngine\<TPresence\>

@roomful/core


@roomful/core / EventEngine

Defined in: packages/core/src/types.ts:1193

Exposes custom event operations for a room.

TPresence extends PresenceData = PresenceData

The custom peer presence shape.

emit<TPayload>(name, payload): void

Defined in: packages/core/src/types.ts:1202

Broadcasts a custom event to the room.

TPayload = unknown

The payload type for this event call.

string

The event channel name.

TPayload

The payload to send.

void

Nothing.


emitTo<TPayload>(peerId, name, payload): void

Defined in: packages/core/src/types.ts:1213

Sends a custom event to a specific peer.

TPayload = unknown

The payload type for this event call.

string

The target peer identifier.

string

The event channel name.

TPayload

The payload to send.

void

Nothing.


off<TPayload>(name, cb): void

Defined in: packages/core/src/types.ts:1236

Removes a custom event listener.

TPayload = unknown

The payload type expected from this channel.

string

The event channel name.

(payload, from) => void

The callback to remove.

void

Nothing.


on<TPayload>(name, cb): Unsubscribe

Defined in: packages/core/src/types.ts:1223

Subscribes to a custom event channel.

TPayload = unknown

The payload type expected from this channel.

string

The event channel name.

(payload, from) => void

The callback invoked with the payload and sending peer.

Unsubscribe

A function that removes the listener.