package com.example.pmulabs.viewModels

import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.setValue
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import com.example.pmulabs.room.models.User
import com.example.pmulabs.room.repository.UserRepository
import kotlinx.coroutines.flow.first
import kotlinx.coroutines.launch

class EntryScreenViewModel(private val userRepository: UserRepository) : ViewModel() {

    var userList by mutableStateOf<List<User>>(emptyList())
    fun setUserList() {
        viewModelScope.launch {
            userList=userRepository.getAllUsers().first()
        }
    }
}