Intellij idea does not show coroutine results but Kotlin Playgroun does
import kotlinx.coroutines.*
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.MutableSharedFlow
import kotlinx.coroutines.flow.launchIn
import kotlinx.coroutines.flow.onEach
import kotlin.random.Random
fun randomSharedFlow(): Flow {
val sharedFlow = MutableSharedFlow()
GlobalScope.launch(Dispatchers.Default) {
for (i in 0 until 10) {
sharedFlow.emit(Random.nextInt(1,100))
delay(200)
}
}
return sharedFlow
}
fun main()...