We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c3b7b20 commit ebff885Copy full SHA for ebff885
kotlinx-coroutines-core/common/src/flow/operators/Transform.kt
@@ -87,7 +87,7 @@ public fun <T> Flow<T>.onEach(action: suspend (T) -> Unit): Flow<T> = transform
87
* ```
88
* flowOf(1, 2, 3).scan(emptyList<Int>()) { acc, value -> acc + value }.toList()
89
90
- * will produce `[], [1], [1, 2], [1, 2, 3]`.
+ * will produce `[[], [1], [1, 2], [1, 2, 3]]`.
91
*
92
* This function is an alias to [runningFold] operator.
93
*/
@@ -100,7 +100,7 @@ public fun <T, R> Flow<T>.scan(initial: R, @BuilderInference operation: suspend
100
101
* flowOf(1, 2, 3).runningFold(emptyList<Int>()) { acc, value -> acc + value }.toList()
102
103
104
105
public fun <T, R> Flow<T>.runningFold(initial: R, @BuilderInference operation: suspend (accumulator: R, value: T) -> R): Flow<R> = flow {
106
var accumulator: R = initial
0 commit comments