Dragos Rachieru
04/01/2022, 7:10 AMViewModel
and some of the navigation componenet multiplatform.gildor
04/01/2022, 7:23 AMgildor
04/01/2022, 7:23 AMIgor Demin
04/01/2022, 7:47 AMDragos Rachieru
04/01/2022, 8:25 AMviewModelScope
for screen rotationsSrSouza
04/01/2022, 5:55 PMalex009
04/04/2022, 2:07 AMgildor
04/04/2022, 2:56 AMI don’t have theShould you just do this on level of DI for different platforms, in case of Android inject viewModelScope, in case of Desktop just pass your app-level scope Personally I fill that it step backward to introduce unnecessary Android abstraction for other platforms where it’s not even a problem. Abstraction on Android to hide viewModel implementation detail looks as better solutionfor screen rotationsviewModelScope
Dragos Rachieru
04/04/2022, 7:40 AMIgor Demin
04/04/2022, 8:33 AMthat looks different based on the screen sizeYou can use BoxWithConstraints to know the current window/screen size. Even on Android you can do this, and disable recreation of Activity in AndroidManifest.xml. Compose reactivity helps a lot to handle configuration changes.
gildor
04/04/2022, 8:41 AMBut what if I need to recreate a composable that looks different based on the screen sizeBut it shouldn’t be responsibility of VM and as Igor mentioned above, it’s already possible to handle on level of composable, why have it on level of VM?
The scope should live when the screen is in the backstack and cancel it when it is removed from backstackIt looks as integration with navigation, yeah, it’s not available out of the box for Desktop, but my question was about VM, I agree, that would be great to have MPP navigation