John Aoussou
11/10/2021, 4:37 PMCsaba Kozák
11/10/2021, 4:41 PMCompositionLocal
to hold the factory, or pass the factory as a parameter to every screen. Depends on your architecture.John Aoussou
11/10/2021, 4:46 PMCsaba Kozák
11/10/2021, 4:48 PM@Composable
fun HomeScreen(factory: ViewModelProvider.Factory) {
val homeViewModel: HomeViewModel = viewModel(factory = factory)
}
Of course you have to create the factory somewhere upwards.John Aoussou
11/10/2021, 4:49 PM