-
-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ViewModel KMP support #130
Comments
There is a workaround for now, Like: @Module
internal class AndroidModule {
@KoinViewModel
fun mainScreenViewModel(parameters: String? = null): MainScreenViewModel {
return MainScreenViewModel(param1 = parameters)
}
} |
@arnaudgiuliani some news about Koin annotation and KMP ViewModel? |
KMP ViewModel for Compose has landed in Koin 3.6. We should be able to generate ViewModel for compose at least. |
On the commonMain, the generated code is working if I'm targetting Android (and has the correct dependancy in the androidMain) but not for iOS, it doesn't have the deps. |
Compose MP ViewModel is available on common sources |
A PR about the issue : #133 |
let's follow up on PR |
@frankois944 with our case, we fixed this issue with below method temporary. made below file on commonMain for making generated file reference it.
|
Hello,
As the InsertKoinIO/koin#1826 is now implemented.
I'm using koin annotation in a KMP project with viewmodel.
I'm using the annotation
@KoinViewModel
in the Shared project.The issue is on iOS target :
The generate code is
the viewmodel is missing as org.koin.androidx.viewmodel.dsl.viewModel is not founded.
For the iOS target, i'm using the dependancies : "koin-core" and "koin-compose".
I'm missing something ?
Thanks
The text was updated successfully, but these errors were encountered: