Kotlin’s analogy to BehaviorSubject is currently knowns as ConflatedBroadcastChannel and it can be represented as flow using asFlow() extension function. However, we plan introduce a new class, tentatively to be named StateFlow, that is going to be specifically targeted to addressing this use-case and will directly implement Flow interfaces. See this discussion for details: https://github.com/Kotlin/kotlinx.coroutines/issues/1082

Written by

Project Lead for the Kotlin Programming Language @JetBrains

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store