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

Interface: EventsNamespace\<TPresence\>

@roomful/svelte


@roomful/svelte / EventsNamespace

Defined in: packages/svelte/src/index.ts:309

Exposes event helpers for the adapter.

TPresence extends PresenceData = PresenceData

The room presence shape.

channel<TPayload>(name): EventChannelStore<TPayload, TPresence>

Defined in: packages/svelte/src/index.ts:317

Creates a readable store for a custom event channel.

TPayload = unknown

The event payload type.

string

The custom event channel name.

EventChannelStore<TPayload, TPresence>

The bound event channel store.


emit<TPayload>(name, payload): void

Defined in: packages/svelte/src/index.ts:327

Broadcasts a custom event.

TPayload = unknown

The event payload type.

string

The custom event channel name.

TPayload

The payload to send.

void

Nothing.


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

Defined in: packages/svelte/src/index.ts:338

Sends a custom event to a specific peer.

TPayload = unknown

The event payload type.

string

The target peer identifier.

string

The custom event channel name.

TPayload

The payload to send.

void

Nothing.


on<TPayload>(name, handler): Unsubscribe

Defined in: packages/svelte/src/index.ts:348

Subscribes to a custom event channel.

TPayload = unknown

The event payload type.

string

The custom event channel name.

(payload, from) => void

The callback invoked for incoming events.

Unsubscribe

A function that removes the listener.