on

open override fun on(event: String, handler: suspend (Map<String, Any?>) -> Unit)

Register a handler for a specific event. The handler will be called whenever the event is received from the server.

Parameters

event

The event name to listen for

handler

Suspend function to handle the event data