rickclephas / KMP-ObservableViewModel

Library to use AndroidX/Kotlin ViewModels with SwiftUI
MIT License
570 stars 28 forks source link

Question: When Can we Expect the support for Jetbrains Compose? #24

Open avidraghav opened 1 year ago

avidraghav commented 1 year ago

Hi Rick, first of all great work. I'm using Compose for iOS in my KMM project hence I can't use this library currently. So do you have any date/month in your mind by which there will be support for Jetbrains Compose? Thanks

rickclephas commented 1 year ago

Hi! I am afraid there is no ETA on Compose support. However it would be very helpful to know how you are using Compose for iOS and what you would expect from KMM-ViewModel.

Note: while there isn't any support for Compose (yet), it's already possible to use ViewModels with StateFlows in Compose.

avidraghav commented 1 year ago

I was going to use this library until I realised there is not Extension function or any way so that the KMM ViewModel from your library can be initialised in a Composable. I guess that will be general requirement. You already got the ViewModel part covered just need to provide some way so that the KMM ViewModel can be initialised in a Composable.

And Yeah I'm using Decompose + KRouter to meet my project requirements

oianmol commented 1 year ago

Hey @avidraghav You can use decompose instanceKeeper to initialize the viewModel!

avidraghav commented 1 year ago

Hi @oianmol, yup I asked this question when I didn't knew about Decompose InstanceKeeper. I'm already using the same in my project Jetstar here Thanks