Hi, I have an jetpack compose project where i use ...
# compose-destinations
r
Hi, I have an jetpack compose project where i use hilt as di but now i am planning to migrating it to koin. before that this will code for my compose screen:
Copy code
@Destination<RootGraph>(style = SlideInScreenAnimation::class)
@Composable
fun ProfileScreen(
    vm: ProfileVM = hiltViewModel()
)
but after using koin it will be:
Copy code
@Destination<RootGraph>(style = SlideInScreenAnimation::class)
@Composable
fun ProfileScreen(
    vm: ProfileVM = koinViewModel()
)
so Profile viewmodel instance will be auto destroy if i navigate to other screen. It work with hiltViewModel but i am not sure about koinViewModel anyone can tell me? Thanks
r
Of course. That should make no difference whatsoever for what Compose Destinations cares about.
r
ohh thanks
r
Glad I could help 🙂
r
There are two type of koinViewModel show: org.koin.compose.viewmodel
Copy code
org.koin.androidx.compose
which one should i use?
r
I have no idea. 🤷 I would check koin docs