This commit is contained in:
2023-11-30 01:27:14 +06:00
parent 871b27f37d
commit a8a5340d8b
2 changed files with 8 additions and 0 deletions

View File

@@ -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<T>(
initialValue: T,
internalScope: CoroutineScope = CoroutineScope(Dispatchers.Default)