package dev.inmo.postssystem.features.common.common

import kotlinx.coroutines.flow.StateFlow
import kotlinx.coroutines.flow.asStateFlow

interface UIViewModel<StateType> {
    val currentState: StateFlow<StateType>
}

abstract class AbstractUIViewModel<StateType> : UIViewModel<StateType> {
    protected val _currentState = DefaultMVVMStateFlow(initState())
    override val currentState: StateFlow<StateType> = _currentState.asStateFlow()

    abstract fun initState(): StateType
}
