Can you point out pros & cons also because I don't see much of a difference
i
Ian Lake
06/15/2021, 5:49 PM
The latest video explains one approach in doing both - pass it in as a parameter, but include a default value for the ViewModel that pulls from Koin, Hilt, etc.:
https://www.youtube.com/watch?v=0z_dwBGQQWQā¾
šš½ 1
š 1
m
ms
06/16/2021, 3:25 AM
So in any case, we can provide the
ViewModel
to a Composable as a parameter or is there any alternative?
d
darkmoon_uk
06/16/2021, 1:46 PM
Passing as a param, defaulted to your DI of choice gets you the best of both worlds:
DI + totally effortless override when you want to throw together a Unit Test etc.
Is there any reason to find an alternative?