( i am a beginner ) how to consume / get state of ...
# mvikotlin
a
( i am a beginner ) how to consume / get state of a store that exposed with decompose component in swift and also in jetpack compose .if i map store model to decompose model then i can expose ObservableWrapper or Observable of type decompose model . if i dont map i get BehaviorObservable or BehaviorObservableWrapper of Store.model . now how can i observe them in swift . in todo example they use asValue but in my case com.arkivanov.mvikotlin.rx.observer is not there . i want to know how to fix this and also if i can observe Observable or BehaviorObservable . thanks in advance .
a
BehaviorObservableWrapper can be observed in Swift the same way as Value. But you will need to write some Swift helpers, similar to what we have for Value. If you want to write Store asValue extension, then you need to add this dependency: https://github.com/JetBrains/compose-multiplatform/blob/ea310cede5f08f7960957369247a6575f7bc5392/examples/todoapp/common/utils/build.gradle.kts#L10.
a
is there any example swift helper for BehaviorObservableWrapper .
a
I have not seen any, but it would be literally equivalent to Value.
If you are using Decompose, then most likely you will have Swit utils for Value anyway. In this case it looks useful to convert Store to Value, to reuse that Swift code. But it's up to you. Utils are small anyway.
a
yes value is working . i was just curious about how to do it with BehaviorObservableWrapper .. anyway thanks for your help.