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

Function: useEvent()

@roomful/vue


@roomful/vue / useEvent

useEvent<TPayload, TPresence>(name, handler): (payload) => void

Defined in: vue/src/index.ts:586

Subscribes to a custom event channel and returns an emitter for that channel.

TPayload = unknown

The payload type for the channel.

TPresence extends PresenceData = PresenceData

The room presence shape.

string

The custom event channel name.

(payload, from) => void

The callback invoked for incoming events.

A function that emits payloads on the same channel.

(payload): void

TPayload

void