Open droidizer opened 1 year ago
`class MealsScreenViewModel (private val repository: Mealsrepo = Mealsrepo()): ViewModel(){
init { viewModelScope.launch(Dispatchers.IO) { val meal = getMeals() mealState.value = meal } } val mealState = mutableStateOf(emptyList<MealResponse>()) private suspend fun getMeals(): List<MealResponse> { return repository.getMeals().categories }
}`
`class MealsScreenViewModel (private val repository: Mealsrepo = Mealsrepo()): ViewModel(){
}`