Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix documentation of Migration.kt #4105

Merged
merged 1 commit into from May 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
20 changes: 10 additions & 10 deletions kotlinx-coroutines-core/common/src/flow/Migration.kt
Expand Up @@ -443,8 +443,8 @@ public fun <T> Flow<T>.scanReduce(operation: suspend (accumulator: T, value: T)
level = DeprecationLevel.ERROR,
message = "Flow analogue of 'publish()' is 'shareIn'. \n" +
"publish().connect() is the default strategy (no extra call is needed), \n" +
"publish().autoConnect() translates to 'started = SharingStared.Lazily' argument, \n" +
"publish().refCount() translates to 'started = SharingStared.WhileSubscribed()' argument.",
"publish().autoConnect() translates to 'started = SharingStarted.Lazily' argument, \n" +
"publish().refCount() translates to 'started = SharingStarted.WhileSubscribed()' argument.",
replaceWith = ReplaceWith("this.shareIn(scope, 0)")
)
public fun <T> Flow<T>.publish(): Flow<T> = noImpl()
Expand All @@ -454,8 +454,8 @@ public fun <T> Flow<T>.publish(): Flow<T> = noImpl()
level = DeprecationLevel.ERROR,
message = "Flow analogue of 'publish(bufferSize)' is 'buffer' followed by 'shareIn'. \n" +
"publish().connect() is the default strategy (no extra call is needed), \n" +
"publish().autoConnect() translates to 'started = SharingStared.Lazily' argument, \n" +
"publish().refCount() translates to 'started = SharingStared.WhileSubscribed()' argument.",
"publish().autoConnect() translates to 'started = SharingStarted.Lazily' argument, \n" +
"publish().refCount() translates to 'started = SharingStarted.WhileSubscribed()' argument.",
replaceWith = ReplaceWith("this.buffer(bufferSize).shareIn(scope, 0)")
)
public fun <T> Flow<T>.publish(bufferSize: Int): Flow<T> = noImpl()
Expand All @@ -465,8 +465,8 @@ public fun <T> Flow<T>.publish(bufferSize: Int): Flow<T> = noImpl()
level = DeprecationLevel.ERROR,
message = "Flow analogue of 'replay()' is 'shareIn' with unlimited replay. \n" +
"replay().connect() is the default strategy (no extra call is needed), \n" +
"replay().autoConnect() translates to 'started = SharingStared.Lazily' argument, \n" +
"replay().refCount() translates to 'started = SharingStared.WhileSubscribed()' argument.",
"replay().autoConnect() translates to 'started = SharingStarted.Lazily' argument, \n" +
"replay().refCount() translates to 'started = SharingStarted.WhileSubscribed()' argument.",
replaceWith = ReplaceWith("this.shareIn(scope, Int.MAX_VALUE)")
)
public fun <T> Flow<T>.replay(): Flow<T> = noImpl()
Expand All @@ -476,16 +476,16 @@ public fun <T> Flow<T>.replay(): Flow<T> = noImpl()
level = DeprecationLevel.ERROR,
message = "Flow analogue of 'replay(bufferSize)' is 'shareIn' with the specified replay parameter. \n" +
"replay().connect() is the default strategy (no extra call is needed), \n" +
"replay().autoConnect() translates to 'started = SharingStared.Lazily' argument, \n" +
"replay().refCount() translates to 'started = SharingStared.WhileSubscribed()' argument.",
"replay().autoConnect() translates to 'started = SharingStarted.Lazily' argument, \n" +
"replay().refCount() translates to 'started = SharingStarted.WhileSubscribed()' argument.",
replaceWith = ReplaceWith("this.shareIn(scope, bufferSize)")
)
public fun <T> Flow<T>.replay(bufferSize: Int): Flow<T> = noImpl()

/** @suppress */
@Deprecated(
level = DeprecationLevel.ERROR,
message = "Flow analogue of 'cache()' is 'shareIn' with unlimited replay and 'started = SharingStared.Lazily' argument'",
replaceWith = ReplaceWith("this.shareIn(scope, Int.MAX_VALUE, started = SharingStared.Lazily)")
message = "Flow analogue of 'cache()' is 'shareIn' with unlimited replay and 'started = SharingStarted.Lazily' argument'",
replaceWith = ReplaceWith("this.shareIn(scope, started = SharingStarted.Lazily, replay = Int.MAX_VALUE)")
)
public fun <T> Flow<T>.cache(): Flow<T> = noImpl()