copySubscriptions
copySubscriptions(
fromChannelName,toChannelName):number[]
Defined in: index.cts:513
DEPRECATED: Use subscribe(fromChannelName, toChannelName) instead.
Copies all subscribers from one channel to another channel. Uses reference counting - if a subscriber is already subscribed to the destination channel, their reference count will be incremented instead of creating duplicate subscriptions.
Parameters
Section titled “Parameters”fromChannelName
Section titled “fromChannelName”string | ArrayBuffer | Uint8Array<ArrayBufferLike>
The source channel name (Buffer, ArrayBuffer, or string).
toChannelName
Section titled “toChannelName”string | ArrayBuffer | Uint8Array<ArrayBufferLike>
The destination channel name (Buffer, ArrayBuffer, or string).
Returns
Section titled “Returns”number[]
An array of socket IDs that were newly added to the destination channel. Sockets that were already subscribed (and had their reference count incremented) are not included.