temit > TemitClient > listener
TemitClient.listener() method
Creates a listener that can be used to receive data from emitters.
Signature:
listener<Arg = unknown>(event: string, group: string, handler: ListenerHandler<Arg>): Listener<Arg>;
Parameters
Parameter | Type | Description |
---|---|---|
event | string | The event name to listen to. |
group | string | Ideally, the name of the action this listener is performing, similar to a function name. Listeners with the same service name and group will be grouped together and have requests round-robin'd between them. |
handler | ListenerHandler<Arg> | The function to run in response to incoming data. |
Returns:
Listener<Arg>