Return type for multicast RPC methods.
When implementing a multicast RPC, simply return the value of type T:
T
public async broadcast(msg: string): RpcMulticastPromise<boolean> { return true; // Just return the raw value} Copy
public async broadcast(msg: string): RpcMulticastPromise<boolean> { return true; // Just return the raw value}
When calling a multicast RPC, use rpcUnwrap to get proper typing:
const results = rpcUnwrap(await this.broadcast("Hello"));for (const r of results) { console.log(`Client ${r.connectionId}: ${r.returnValue}`);} Copy
const results = rpcUnwrap(await this.broadcast("Hello"));for (const r of results) { console.log(`Client ${r.connectionId}: ${r.returnValue}`);}
The value type returned by each client's implementation
Return type for multicast RPC methods.
When implementing a multicast RPC, simply return the value of type
T:When calling a multicast RPC, use rpcUnwrap to get proper typing: