Home > paper-cups > RpcClient > subscribe
Subscribe to messages of type opcode.
Signature:
subscribe<ReturnData = any>(opcode: string, handler: Subscriber<ReturnData>): () => void;
Parameter | Type | Description |
---|---|---|
opcode | string | An opcode indicating the procedure being executed. |
handler | Subscriber<ReturnData> | A subscriber function that will be invoked when a response message is received. |
Returns:
() => void
unsubscribe handler