Created
January 20, 2021 17:21
-
-
Save qwert2603/c405d7b2edf01c80048b519599b64e8e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected class ViewModelStateFlowImpl<T>(initial: T) : ViewModelStateFlow<T> { | |
val wrapped = MutableStateFlow(initial) | |
override val value: T | |
get() = wrapped.value | |
override val replayCache: List<T> | |
get() = wrapped.replayCache | |
@InternalCoroutinesApi | |
override suspend fun collect(collector: FlowCollector<T>) { | |
wrapped.collect(collector) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment