Migrate to AndroidX ViewModel from Voyager ScreenModel (#3594)

This commit is contained in:
AntsyLich
2026-07-15 21:19:11 +06:00
committed by GitHub
parent ef1c529672
commit c3b99aea07
91 changed files with 1503 additions and 1091 deletions
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest />
@@ -0,0 +1,11 @@
package mihon.core.viewmodel
import androidx.lifecycle.ViewModel
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.StateFlow
import kotlinx.coroutines.flow.asStateFlow
abstract class StateViewModel<S>(initialState: S) : ViewModel() {
protected val mutableState: MutableStateFlow<S> = MutableStateFlow(initialState)
val state: StateFlow<S> = mutableState.asStateFlow()
}