onMessage

inline fun <M : Message<*>> Component<*>.onMessage(noinline handler: (M) -> Unit)

Listens for a Message of the given type M.