onEvent

fun WebApp.onEvent(type: EventType, eventHandler: EventHandler): () -> Unit
fun WebApp.onEvent(type: EventType.ViewportChanged, eventHandler: ViewportChangedEventHandler): (ViewportChangedData) -> Unit

Return

The callback which should be used in case you want to turn off events handling