We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 96de301 commit 64ef375Copy full SHA for 64ef375
kotlinx-coroutines-core/common/src/flow/SharingStarted.kt
@@ -1,6 +1,8 @@
1
package kotlinx.coroutines.flow
2
3
import kotlinx.coroutines.*
4
+import kotlinx.coroutines.flow.internal.*
5
+import kotlinx.coroutines.flow.internal.unsafeFlow
6
import kotlinx.coroutines.internal.IgnoreJreRequirement
7
import kotlin.time.*
8
@@ -146,7 +148,7 @@ private class StartedEagerly : SharingStarted {
146
148
}
147
149
150
private class StartedLazily : SharingStarted {
- override fun command(subscriptionCount: StateFlow<Int>): Flow<SharingCommand> = flow {
151
+ override fun command(subscriptionCount: StateFlow<Int>): Flow<SharingCommand> = unsafeFlow {
152
var started = false
153
subscriptionCount.collect { count ->
154
if (count > 0 && !started) {
0 commit comments