mvi-architecture
MVI Architecture
Unidirectional data flow architecture for Android and Compose Multiplatform.
Intent → ViewModel → State → UI
↑ │
└────────────────────────┘
Everything below compiles in commonMain: ViewModel/viewModelScope, collectAsStateWithLifecycle, and repeatOnLifecycle all have commonMain declarations. Mind the group id — a Compose Multiplatform module consumes the JetBrains-published build, org.jetbrains.androidx.lifecycle:lifecycle-viewmodel / :lifecycle-runtime-compose (2.11.0); an Android-only module consumes androidx.lifecycle:*. AndroidX's own artifacts are multiplatform too, but lifecycle-runtime-compose only started publishing Native/Wasm klibs at 2.9.3, while lifecycle-viewmodel and lifecycle-runtime have shipped them since 2.8.0.
DI wiring: kmp-di / android-di-koin. Result mapping: error-handling-result. Test tooling: mobile-testing.
State
One data class per screen, all fields with defaults so the initial value is HomeState().