Marcel
10/08/2024, 10:43 AMabstract class StateFlowViewModel<State, Action>() : ViewModel() {
abstract val initialState: State
protected val mutableState: MutableStateFlow<State> by lazy { MutableStateFlow(initialState) }
open val state: StateFlow<State>
get() = mutableState
... // Some other stuff
}
@KoinViewModel
class FeatureViewModel(
@Provided private val permissionsController: PermissionsController,
private val stateHandler: FeatureStateHandler,
) : StateFlowViewModel<FeatureState, FeatureAction>() {
override val initialState = stateHandler.handleInitialState()
... // Some other stuff
}
state
anywhere, I have even tried adding a silly fun helloIos()
function and that one is not available either.Marcel
10/08/2024, 1:33 PM