onTyped

inline fun <T> onTyped(event: String, crossinline callback: suspend (T) -> Unit): SocketSession

Registers a typed event listener for a specific event, decoding the event data to the specified type.

Return

The updated SocketSession instance.

Parameters

event

The event name.

callback

A suspend function to handle the event with a typed argument.