doc
This commit is contained in:
@@ -50,6 +50,12 @@ RPC did not provide a name.
|
||||
throw new Error("Bad socketIORPC type "+ typeof rpc)
|
||||
}
|
||||
|
||||
/**
|
||||
* Utility function to apply the RPCs of an {@link Exporter}.
|
||||
* @param socket The websocket (implementation: bsock) to hook on
|
||||
* @param exporter The exporter
|
||||
* @param makeUnique @default true Attach a suffix to RPC names
|
||||
*/
|
||||
export function rpcHooker<SubResT = {}>(socket: I.Socket, exporter:I.Exporter<SubResT>, makeUnique = true):T.ExtendedRpcInfo[]{
|
||||
const owner = exporter.name
|
||||
const RPCs = [...exporter.exportRPCs()]
|
||||
|
||||
Reference in New Issue
Block a user