Skip to content

Commit dbf365c

Browse files
committed
Demote switchMap and combineLatest to preview features as we may want to rework in #1262 and #1335
1 parent bc46e8d commit dbf365c

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ public fun <T> Flow<Flow<T>>.flattenMerge(concurrency: Int = DEFAULT_CONCURRENCY
125125
* ```
126126
* produces `aa bb b_last`
127127
*/
128-
@ExperimentalCoroutinesApi
128+
@FlowPreview
129129
public fun <T, R> Flow<T>.switchMap(transform: suspend (value: T) -> Flow<R>): Flow<R> = scopedFlow { downstream ->
130130
var previousFlow: Job? = null
131131
collect { value ->

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

+5-5
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import kotlinx.coroutines.flow.unsafeFlow as flow
2828
* }
2929
* ```
3030
*/
31-
@ExperimentalCoroutinesApi
31+
@FlowPreview
3232
public fun <T1, T2, R> Flow<T1>.combineLatest(other: Flow<T2>, transform: suspend (T1, T2) -> R): Flow<R> = flow {
3333
coroutineScope {
3434
val firstChannel = asFairChannel(this@combineLatest)
@@ -80,7 +80,7 @@ public fun <T1, T2, R> Flow<T1>.combineLatest(other: Flow<T2>, transform: suspen
8080
* Returns a [Flow] whose values are generated with [transform] function by combining
8181
* the most recently emitted values by each flow.
8282
*/
83-
@ExperimentalCoroutinesApi
83+
@FlowPreview
8484
public inline fun <T1, T2, T3, R> Flow<T1>.combineLatest(
8585
other: Flow<T2>,
8686
other2: Flow<T3>,
@@ -97,7 +97,7 @@ public inline fun <T1, T2, T3, R> Flow<T1>.combineLatest(
9797
* Returns a [Flow] whose values are generated with [transform] function by combining
9898
* the most recently emitted values by each flow.
9999
*/
100-
@ExperimentalCoroutinesApi
100+
@FlowPreview
101101
public inline fun <T1, T2, T3, T4, R> Flow<T1>.combineLatest(
102102
other: Flow<T2>,
103103
other2: Flow<T3>,
@@ -116,7 +116,7 @@ public inline fun <T1, T2, T3, T4, R> Flow<T1>.combineLatest(
116116
* Returns a [Flow] whose values are generated with [transform] function by combining
117117
* the most recently emitted values by each flow.
118118
*/
119-
@ExperimentalCoroutinesApi
119+
@FlowPreview
120120
public inline fun <T1, T2, T3, T4, T5, R> Flow<T1>.combineLatest(
121121
other: Flow<T2>,
122122
other2: Flow<T3>,
@@ -137,7 +137,7 @@ public inline fun <T1, T2, T3, T4, T5, R> Flow<T1>.combineLatest(
137137
* Returns a [Flow] whose values are generated with [transform] function by combining
138138
* the most recently emitted values by each flow.
139139
*/
140-
@ExperimentalCoroutinesApi
140+
@FlowPreview
141141
public inline fun <reified T, R> Flow<T>.combineLatest(vararg others: Flow<T>, crossinline transform: suspend (Array<T>) -> R): Flow<R> =
142142
combineLatest(*others, arrayFactory = { arrayOfNulls(others.size + 1) }, transform = { transform(it) })
143143

0 commit comments

Comments
 (0)