diff --git a/coroutines/compose/src/commonMain/kotlin/dev/inmo/micro_utils/coroutines/compose/FlowState.kt b/coroutines/compose/src/commonMain/kotlin/dev/inmo/micro_utils/coroutines/compose/FlowState.kt index 3df38d3b07c..487f1065564 100644 --- a/coroutines/compose/src/commonMain/kotlin/dev/inmo/micro_utils/coroutines/compose/FlowState.kt +++ b/coroutines/compose/src/commonMain/kotlin/dev/inmo/micro_utils/coroutines/compose/FlowState.kt @@ -8,6 +8,10 @@ import dev.inmo.micro_utils.coroutines.doInUI import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers +/** + * This type works like [MutableState], [kotlinx.coroutines.flow.StateFlow] and [kotlinx.coroutines.flow.MutableSharedFlow]. + * Based on [SpecialMutableStateFlow] + */ class FlowState( initial: T, internalScope: CoroutineScope = CoroutineScope(Dispatchers.Default) diff --git a/coroutines/src/commonMain/kotlin/dev/inmo/micro_utils/coroutines/SpecialStateFlow.kt b/coroutines/src/commonMain/kotlin/dev/inmo/micro_utils/coroutines/SpecialStateFlow.kt index 9e5ca662cb7..adb2a18793e 100644 --- a/coroutines/src/commonMain/kotlin/dev/inmo/micro_utils/coroutines/SpecialStateFlow.kt +++ b/coroutines/src/commonMain/kotlin/dev/inmo/micro_utils/coroutines/SpecialStateFlow.kt @@ -9,6 +9,10 @@ import kotlinx.coroutines.flow.MutableSharedFlow import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.StateFlow +/** + * Works like [StateFlow], but guarantee that latest value update will always be delivered to + * each active subscriber + */ open class SpecialMutableStateFlow( initialValue: T, internalScope: CoroutineScope = CoroutineScope(Dispatchers.Default)