on
- on(
event,fn)
Attaches an event handler to the specified event.
Parameters
Example
In the below example, we are listening for the call.state event and logging the current call state to the console.
This means this will be triggered every time the call state changes.