mirror of
https://github.com/InsanusMokrassar/MicroUtils.git
synced 2024-11-22 16:23:50 +00:00
kdocs
This commit is contained in:
parent
871b27f37d
commit
a8a5340d8b
@ -8,6 +8,10 @@ import dev.inmo.micro_utils.coroutines.doInUI
|
|||||||
import kotlinx.coroutines.CoroutineScope
|
import kotlinx.coroutines.CoroutineScope
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This type works like [MutableState], [kotlinx.coroutines.flow.StateFlow] and [kotlinx.coroutines.flow.MutableSharedFlow].
|
||||||
|
* Based on [SpecialMutableStateFlow]
|
||||||
|
*/
|
||||||
class FlowState<T>(
|
class FlowState<T>(
|
||||||
initial: T,
|
initial: T,
|
||||||
internalScope: CoroutineScope = CoroutineScope(Dispatchers.Default)
|
internalScope: CoroutineScope = CoroutineScope(Dispatchers.Default)
|
||||||
|
@ -9,6 +9,10 @@ import kotlinx.coroutines.flow.MutableSharedFlow
|
|||||||
import kotlinx.coroutines.flow.MutableStateFlow
|
import kotlinx.coroutines.flow.MutableStateFlow
|
||||||
import kotlinx.coroutines.flow.StateFlow
|
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<T>(
|
open class SpecialMutableStateFlow<T>(
|
||||||
initialValue: T,
|
initialValue: T,
|
||||||
internalScope: CoroutineScope = CoroutineScope(Dispatchers.Default)
|
internalScope: CoroutineScope = CoroutineScope(Dispatchers.Default)
|
||||||
|
Loading…
Reference in New Issue
Block a user