Colton Idle
08/16/2021, 8:44 PM@HiltViewModel
class MyScreenViewModel
@Inject
constructor(var navEvent: (String) -> Unit)
which makes sure that this navEvent is passed in.
fun MyScreen(viewModel: MyScreenViewModel = hiltViewModel(//how do I pass something in))
Is there an easy way to pass in a lambda? I've passed arguments into viewModels with compose before but hiltViewModel did all the heavy lifting and exposed the argument via savedStateHandle. Can I somehow pass this lambda into my savedStateHandle? I'd be okay with that.Ian Lake
08/16/2021, 9:24 PMColton Idle
08/16/2021, 9:39 PMK Merle
08/17/2021, 8:46 AMColton Idle
08/17/2021, 1:48 PM