A lightweight JSON RPC client & server
Home > async-call-rpc > EventBasedChannel > on
Register the message listener.
Signature:
on(listener: (data: Data, hint?: 'request' | 'response' | undefined) => void): void | (() => void);
Parameter | Type | Description |
---|---|---|
listener | (data: Data, hint?: ‘request’ | ‘response’ | undefined) => void | The message listener. |
Returns:
void | (() => void)
a function that unregister the listener.