@@ -38,19 +38,17 @@ public enum class SharingCommand {
3838/* *
3939 * A strategy for starting and stopping the sharing coroutine in [shareIn] and [stateIn] operators.
4040 *
41- * This interface provides a set of built-in strategies: [Eagerly], [Lazily], [WhileSubscribed], and
41+ * This functional interface provides a set of built-in strategies: [Eagerly], [Lazily], [WhileSubscribed], and
4242 * supports custom strategies by implementing this interface's [command] function.
4343 *
4444 * For example, it is possible to define a custom strategy that starts the upstream only when the number
4545 * of subscribers exceeds the given `threshold` and make it an extension on [SharingStarted.Companion] so
4646 * that it looks like a built-in strategy on the use-site:
4747 *
4848 * ```
49- * fun SharingStarted.Companion.WhileSubscribedAtLeast(threshold: Int): SharingStarted =
50- * object : SharingStarted {
51- * override fun command(subscriptionCount: StateFlow<Int>): Flow<SharingCommand> =
52- * subscriptionCount
53- * .map { if (it >= threshold) SharingCommand.START else SharingCommand.STOP }
49+ * fun SharingStarted.Companion.WhileSubscribedAtLeast(threshold: Int) =
50+ * SharingStarted { subscriptionCount: StateFlow<Int> ->
51+ * subscriptionCount.map { if (it >= threshold) SharingCommand.START else SharingCommand.STOP }
5452 * }
5553 * ```
5654 *
@@ -74,7 +72,7 @@ public enum class SharingCommand {
7472 * The completion of the `command` flow normally has no effect (the upstream flow keeps running if it was running).
7573 * The failure of the `command` flow cancels the sharing coroutine and the upstream flow.
7674 */
77- public interface SharingStarted {
75+ public fun interface SharingStarted {
7876 public companion object {
7977 /* *
8078 * Sharing is started immediately and never stops.
0 commit comments