package com.various.funny.sounds.audio.ui.activity

import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import com.various.funny.sounds.audio.data.NewBeanChild
import com.various.funny.sounds.audio.db.MyRoomBase
import kotlinx.coroutines.launch

class SourceViewModel : ViewModel() {

    private var _mdata: MutableLiveData<List<NewBeanChild>> = MutableLiveData<List<NewBeanChild>>()


    fun query(id: String) {
        viewModelScope.launch {
            _mdata.value = MyRoomBase.dataBase.getNewBeanChildDao().getData(id)
        }
    }

    fun getList() = _mdata

    override fun onCleared() {
        super.onCleared()
    }


}