python (65.1k questions)
javascript (44.2k questions)
reactjs (22.7k questions)
java (20.8k questions)
c# (17.4k questions)
html (16.3k questions)
r (13.7k questions)
android (12.9k questions)
How to Unit Test a ViewModel using Flows and LiveData with runTest?
Imagine my ViewModel looks like this :
class ViewModelA(
repository: Repository,
ioCoroutineDispatcher: CoroutineDispatcher,
) : ViewModel() {
val liveData : LiveData<String> = repos...
Nino DELCEY
Votes: 0
Answers: 1
Live data observer called before getting the data from API/Database
I am using Firebase Firestore as Database and getting data from firestore. I am calling categoryList data from function from Home Fragment-->ViewModel-->Repository(Suspend function) and obseve t...
Ketan
Votes: 0
Answers: 1
Why not auto update list when used LiveData in Android
In my application I want use Koin , Room and LiveData.
I write below codes, but after add new item into room not auto update recyclerview list!
Should close app and open again for show updated list !...
Dr.KeyOk
Votes: 0
Answers: 1
How to initialize a field in viewModel with suspend method
How to initialize a field in view model if I need to call the suspend function to get the value?
I a have suspend function that returns value from a database.
suspend fun fetchProduct(): Product
When...
Sasha Arutyunyan
Votes: 0
Answers: 3