Tlaster / PreCompose

Compose Multiplatform Navigation && State Management
https://tlaster.github.io/PreCompose/
MIT License
868 stars 50 forks source link

Support for Google's Viewmodel which recently went multi-platform #289

Open kawaiiDango opened 8 months ago

kawaiiDango commented 8 months ago

(Feature request)

According to https://issuetracker.google.com/issues/214568825 viewmodel is now multi-platform. It would be nice to have support for that if possible.

Edit, looks like viewmodel-compose isn't, yet. It can be tracked here https://issuetracker.google.com/issues/330323282

Tlaster commented 8 months ago

With the recent release of multiplatform support for Jetpack Lifecycle and ViewModel, I think we can expect Jetpack Navigation Compose to be multiplatform, which can be tracked here https://issuetracker.google.com/issues/281774647. My initial thought is that we can migrate PreCompose's Lifecycle and ViewModel to Jetpack's implementation and deprecate the current implementation, but I haven't decided yet.

Sanlorng commented 7 months ago

With the recent release of multiplatform support for Jetpack Lifecycle and ViewModel, I think we can expect Jetpack Navigation Compose to be multiplatform, which can be tracked here https://issuetracker.google.com/issues/281774647. My initial thought is that we can migrate PreCompose's Lifecycle and ViewModel to Jetpack's implementation and deprecate the current implementation, but I haven't decided yet.

See Jetbrains branch Navigation Multiplatform Lifecycle Multiplatform ViewModel Multiplatform Maven Repository

ColtonIdle commented 6 months ago

My initial thought is that we can migrate PreCompose's Lifecycle and ViewModel to Jetpack's implementation and deprecate the current implementation

That makes sense to me. Is there a benefit to not doing that?

Tlaster commented 6 months ago

My initial thought is that we can migrate PreCompose's Lifecycle and ViewModel to Jetpack's implementation and deprecate the current implementation

That makes sense to me. Is there a benefit to not doing that?

I think using Jetpack's Lifecycle and ViewModel is the best solution, but since the official Navigation is coming, I starting to think about maybe PreCompose have done its job.

Sanlorng commented 6 months ago

My initial thought is that we can migrate PreCompose's Lifecycle and ViewModel to Jetpack's implementation and deprecate the current implementation

That makes sense to me. Is there a benefit to not doing that?

I think using Jetpack's Lifecycle and ViewModel is the best solution, but since the official Navigation is coming, I starting to think about maybe PreCompose have done its job.

But for now,Navigation Multiplatform does not support BackHandle and NavigateForResult API