Support of defaultArgs
in the Screen.getViewModel()
method
#251
Labels
di: hilt
"Hilt" dependency injection issue
defaultArgs
in the Screen.getViewModel()
method
#251
Problem:
I want my ViewModels to be able to receive through Hilt:
Solution:
Default args for a savedStateHandle is one of the currently recommended ways to pass navigation arguments to the ViewModel.
I've looked into code and it seems like it would be pretty easy to add
defaultArgs
support into Voyager.So it will look something like:
I can make PR if this solution looks ok.
And by the way looks like Dagger team finally made a solution for a
@AssistedInject
issue, I found it in the Dagger documentation but some APIs not released yet.The text was updated successfully, but these errors were encountered: