package com.za.base

import androidx.compose.runtime.mutableStateOf
import androidx.lifecycle.ViewModel

abstract class BaseVm<T, U> : ViewModel() {
    val tag: String = javaClass.simpleName
    abstract fun updateState(uiState: U)
    abstract fun dispatch(action: T)

    companion object {
        val showTipDialog = mutableStateOf<String?>(null)//提示框
        fun showTipDialog(msg: String) {
            showTipDialog.value = msg
        }

        fun hideTipDialog() {
            showTipDialog.value = null
        }
    }
}

sealed class LoadState {
    data object Init : LoadState()
    data object Success : LoadState()
    data object Failed : LoadState()
}