method Room.prototype.broadcastJson
Room.prototype.broadcastJson<T>(
payload: T,
): void

Serializes a value to JSON once and broadcasts it as a text frame.

Type Parameters

The payload type

Parameters

payload: T

The value to serialize

optional
options: RoomBroadcastOptions

Broadcast options

Return Type

void

Usage

import { Room } from "websocket-plugin/src/index.ts";