onMessage

fun onMessage(handler: suspend (Message) -> Unit)

Sets the handler invoked for each new message (preview content only).