Migrate view models from `State` to `StateFlow`
StateFlow
as provided by Kotlin coroutines
has the following advantages:
- operations similar to
Transformations.map
(onLiveData
) allow to implicitly update a "state" whose value depends on another one (e.g., currently inContactListViewModel
, we have to update the exposed list by an explicit function call) -
StateFlow
is recommended and used in several places for Jetpack Compose and Compose for Desktop - the view models will be independent of the the UI framework and could be re-used for the Android app
We most certainly want to include coroutines
as a dependency anyhow, if we want to move all (long-running) Briar API calls to a background thread (in a Kotlin-ish way) > see #98 (closed) .