python (65.2k questions)
javascript (44.3k questions)
reactjs (22.7k questions)
java (20.8k questions)
c# (17.4k questions)
html (16.3k questions)
r (13.7k questions)
android (13k questions)
Migrate MainCoroutineRule
I want create MainCoroutineRule.
But TestCoroutineScope deprecated since 1.6.0.
How can I migrate it?
Below is my MainCoroutineRule
class MainCoroutineRule(
val dispatcher: TestCoroutineDispatcher...
HongJeongHyeon
Votes: 0
Answers: 2
Avoid repetitive launch when emitting value using Flow, StateFlow, SharedFlow
I am migrating from LiveData to Coroutine Flows specifically StateFlow and SharedFlow. Unfortunately emitting values should run on a CoroutineScope thus you have this ugly repetitive code viewModelSco...
Bitwise DEVS
Votes: 0
Answers: 1
Implementing CoroutineScope in ViewModel
Why and when do we actually need to implement CoroutineScope in a ViewModel. Inside ViewModel you can use viewModelScope when you want to tied your Coroutine to the ViewModel thus when onCleared gets ...
Bitwise DEVS
Votes: 0
Answers: 2
Propagate exception thrown from Continuation::resumeWith() back to the calling await()
I have the following coroutine and corresponding Java wrapper:
suspend fun test() : String {
delay(1000)
return "OK"
}
@JvmOverloads
fun testWrapper(scope: CoroutineScope = Coroutin...
jox
Votes: 0
Answers: 0