diff --git a/CHANGELOG.md b/CHANGELOG.md index 694fe0fa745..ada66eaee48 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,9 @@ * `Versions` * `Serialization`: `1.0.0` -> `1.0.1` +* `Coroutines` + * `BroadcastFlow` now is deprecated + * `BroadcastStateFlow` now is deprecated ## 0.2.3 diff --git a/coroutines/src/commonMain/kotlin/dev/inmo/micro_utils/coroutines/BroadcastFlow.kt b/coroutines/src/commonMain/kotlin/dev/inmo/micro_utils/coroutines/BroadcastFlow.kt index d3ff5b0b277..f4c18906a82 100644 --- a/coroutines/src/commonMain/kotlin/dev/inmo/micro_utils/coroutines/BroadcastFlow.kt +++ b/coroutines/src/commonMain/kotlin/dev/inmo/micro_utils/coroutines/BroadcastFlow.kt @@ -4,6 +4,7 @@ import kotlinx.coroutines.channels.* import kotlinx.coroutines.flow.* @Suppress("FunctionName") +@Deprecated("Deprecated due to stabilization of SharedFlow and StateFlow") fun BroadcastFlow( internalChannelSize: Int = Channel.BUFFERED ): BroadcastFlow { @@ -15,6 +16,7 @@ fun BroadcastFlow( ) } +@Deprecated("Deprecated due to stabilization of SharedFlow and StateFlow") class BroadcastFlow internal constructor( private val channel: BroadcastChannel, private val flow: Flow diff --git a/coroutines/src/commonMain/kotlin/dev/inmo/micro_utils/coroutines/BroadcastStateFlow.kt b/coroutines/src/commonMain/kotlin/dev/inmo/micro_utils/coroutines/BroadcastStateFlow.kt index e2ad31a4af3..53d29ae713f 100644 --- a/coroutines/src/commonMain/kotlin/dev/inmo/micro_utils/coroutines/BroadcastStateFlow.kt +++ b/coroutines/src/commonMain/kotlin/dev/inmo/micro_utils/coroutines/BroadcastStateFlow.kt @@ -7,6 +7,7 @@ import kotlinx.coroutines.flow.* const val defaultBroadcastStateFlowReplayCacheSize = 1 +@Deprecated("Deprecated due to stabilization of SharedFlow and StateFlow") class BroadcastStateFlow internal constructor( parentFlow: Flow, initial: T, @@ -34,17 +35,20 @@ class BroadcastStateFlow internal constructor( } } +@Deprecated("Deprecated due to stabilization of SharedFlow and StateFlow") fun BroadcastChannel.asStateFlow( value: T, scope: CoroutineScope, replayCacheSize: Int = defaultBroadcastStateFlowReplayCacheSize ): StateFlow = BroadcastStateFlow(asFlow(), value, replayCacheSize, scope) +@Deprecated("Deprecated due to stabilization of SharedFlow and StateFlow") fun BroadcastChannel.asStateFlow( scope: CoroutineScope, replayCacheSize: Int = defaultBroadcastStateFlowReplayCacheSize ): StateFlow = asStateFlow(null, scope, replayCacheSize) +@Deprecated("Deprecated due to stabilization of SharedFlow and StateFlow") fun broadcastStateFlow( initial: T, scope: CoroutineScope, channelSize: Int = Channel.BUFFERED, @@ -55,6 +59,7 @@ fun broadcastStateFlow( it to it.asStateFlow(initial, scope, replayCacheSize) } +@Deprecated("Deprecated due to stabilization of SharedFlow and StateFlow") fun broadcastStateFlow( scope: CoroutineScope, channelSize: Int = Channel.BUFFERED,