Skip to content

Commit b9c352c

Browse files
committed
~ tranformWhile workaround, too
1 parent b8e5126 commit b9c352c

File tree

1 file changed

+2
-1
lines changed
  • kotlinx-coroutines-core/common/src/flow/operators

1 file changed

+2
-1
lines changed

kotlinx-coroutines-core/common/src/flow/operators/Limit.kt

+2-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,8 @@ public fun <T, R> Flow<T>.transformWhile(
102102
@BuilderInference transform: suspend FlowCollector<R>.(value: T) -> Boolean
103103
): Flow<R> =
104104
safeFlow { // Note: safe flow is used here, because collector is exposed to transform on each operation
105-
collectWhile { value ->
105+
// This return is needed to work around a bug in JS BE: KT-39227
106+
return@safeFlow collectWhile { value ->
106107
transform(value)
107108
}
108109
}

0 commit comments

Comments
 (0)