useCustomEventResult<T>

Type parameters

Name
T

Properties

sendEvent

sendEvent: (data: T, receiver?: EventReceiver) => void

Type declaration

▸ (data, receiver?): void

sends the event data to others in the room who will receive it in onEvent

Parameters
NameType
dataT
receiver?EventReceiver
Returns

void

Example

to send message to peers of specific roles

sendEvent(data, { roleNames: ['host', 'guest'] });

Example

to send message to single peer

sendEvent(data, { peerId });

Have a suggestion? Recommend changes ->

Was this helpful?

1234