Interface: EventChannelStore\<TPayload, TPresence\>
@roomful/svelte / EventChannelStore
Interface: EventChannelStore<TPayload, TPresence>
Section titled “Interface: EventChannelStore<TPayload, TPresence>”Defined in: packages/svelte/src/index.ts:282
Readable event channel store augmented with emit helpers.
Extends
Section titled “Extends”Readable<EventChannelValue<TPayload,TPresence> |null>
Type Parameters
Section titled “Type Parameters”TPayload
Section titled “TPayload”TPayload = unknown
The event payload type.
TPresence
Section titled “TPresence”TPresence extends PresenceData = PresenceData
The room presence shape.
Methods
Section titled “Methods”emit()
Section titled “emit()”emit(
payload):void
Defined in: packages/svelte/src/index.ts:292
Broadcasts an event on the bound channel.
Parameters
Section titled “Parameters”payload
Section titled “payload”TPayload
The payload to send.
Returns
Section titled “Returns”void
Nothing.
emitTo()
Section titled “emitTo()”emitTo(
peerId,payload):void
Defined in: packages/svelte/src/index.ts:301
Sends an event on the bound channel to a specific peer.
Parameters
Section titled “Parameters”peerId
Section titled “peerId”string
The target peer identifier.
payload
Section titled “payload”TPayload
The payload to send.
Returns
Section titled “Returns”void
Nothing.
subscribe()
Section titled “subscribe()”subscribe(
this,run,invalidate?):Unsubscriber
Defined in: node_modules/.pnpm/svelte@4.2.20/node_modules/svelte/types/index.d.ts:1619
Subscribe on value changes.
Parameters
Section titled “Parameters”void
Subscriber<EventChannelValue<TPayload, TPresence> | null>
subscription callback
invalidate?
Section titled “invalidate?”Invalidator<EventChannelValue<TPayload, TPresence> | null>
cleanup callback
Returns
Section titled “Returns”Unsubscriber
Inherited from
Section titled “Inherited from”Readable.subscribe