suspend fun heyStackOverFlow(): Int {
val flow1 = flow<Int> { 1 }
val flow2 = flow<Int> { 2 }
return flow1.combine(flow2) { f1, f2 -> f1 + f2 }.single()
}
I use this in build.gradle
sourceSets {
val commonMain by getting {
dependencies {
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.2-native-mt")
...
}
}
I get this error
kotlin.IllegalStateException: There is no event loop. Use runBlocking { ... } to start one.
I've tried playing around with actual / expected dispatchers from other questions but no success. On android this works perfectly, on ios it doesn't.