Skip to content

Coroutines Interop #46

Answered by arkivanov
Intektor asked this question in Q&A
Mar 10, 2022 · 1 comments · 4 replies
Discussion options

You must be logged in to vote

Hello and thanks for the question.

I was wondering why you use your own State implementation instead of using MutableStateFlow

This is required to avoid direct dependency on kotlinx.coroutines. One may prefer another library (e.g. Reaktive or RxJava). Or if Jetpack Compose is used as UI framework, then there is State and you may not need coroutines as well.

Another benefit of using Value is better interoperability with Swift. Value is a normal class with normal functions and callbacks - it can be easily exposed to Swift and subscribed/unsubscribed there.

Also please note, that Value is directly used only in Router. Usually its state is exposed to UI and subscribed without coroutines - e…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@Burtan
Comment options

@arkivanov
Comment options

@arkivanov
Comment options

@arkivanov
Comment options

Answer selected by Intektor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #45 on March 10, 2022 16:03.