ScreenViewModel
Base ViewModel for a screen: owns its state S, handles its events E, and queues the messages it shows.
S is whatever the feature declares, usually a data class. The status of each piece of content that loads is a field of it, often a Loadable, so a screen that loads several things gives each its own status, and a screen that starts with its content needs none. Every change goes through setState, one atomic update, so coroutines writing at the same time never drop each other's change.
Messages are kept apart from S because every screen shows them the same way: showMessage queues one and MessageHost shows the queue in order, calling messageShown as each leaves. Being state rather than a one-off event, a message survives a configuration change.
Subclasses implement handleEvent; onEvent is the entry point the UI calls.
Inheritors
Properties
Functions
Removes the message with id from the queue, once it has been shown.