Skip to content

Commit 25d34cc

Browse files
author
yunjoo-park
committed
Correct docs
- flatMapConcat is a shortcut for `map().flattenConcat()` and flatMapMerge is a shorcut for `map().flattenMerge()`
1 parent 22087ef commit 25d34cc

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

docs/flow.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1117,7 +1117,7 @@ as such, there is a family of flattening operators on flows.
11171117

11181118
#### flatMapConcat
11191119

1120-
Concatenating mode is implemented by [flatMapConcat] and [flattenConcat] operators. They are the most direct
1120+
Concatenating mode is implemented by [map] and [flattenConcat] operators. They are the most direct
11211121
analogues of the corresponding sequence operators. They wait for the inner flow to complete before
11221122
starting to collect the next one as the following example shows:
11231123

@@ -1166,7 +1166,7 @@ The sequential nature of [flatMapConcat] is clearly seen in the output:
11661166

11671167
Another flattening mode is to concurrently collect all the incoming flows and merge their values into
11681168
a single flow so that values are emitted as soon as possible.
1169-
It is implemented by [flatMapMerge] and [flattenMerge] operators. They both accept an optional
1169+
It is implemented by [map] and [flattenMerge] operators. They both accept an optional
11701170
`concurrency` parameter that limits the number of concurrent flows that are collected at the same time
11711171
(it is equal to [DEFAULT_CONCURRENCY] by default).
11721172

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public val DEFAULT_CONCURRENCY: Int = systemProp(DEFAULT_CONCURRENCY_PROPERTY_NA
3434
* Transforms elements emitted by the original flow by applying [transform], that returns another flow,
3535
* and then concatenating and flattening these flows.
3636
*
37-
* This method is is a shortcut for `map(transform).flattenConcat()`. See [flattenConcat].
37+
* This method is a shortcut for `map(transform).flattenConcat()`. See [flattenConcat].
3838
*
3939
* Note that even though this operator looks very familiar, we discourage its usage in a regular application-specific flows.
4040
* Most likely, suspending operation in [map] operator will be sufficient and linear transformations are much easier to reason about.

0 commit comments

Comments
 (0)