I found setting up hilt with Mavericks to be a right pain. Firstly take a look at the sample,
https://github.com/airbnb/mavericks/tree/master/hellohilt.
You need to copy the following files from it into your project:
AssistedViewModelFactory.kt
MavericksViewModelScoped.kt
ViewModelKey.kt
ViewModelsModule.kt
hiltMavericksViewModelFactory.kt
Your viewmodel then needs assistedinject and an assistedfactory added before âby fragmentViewModel()â will work in your fragment.
Personally I found this all far too much, both from a copy and paste point of view and a boilerplate code point of view.
If youâre only just starting to look at MVI check out
https://github.com/orbit-mvi/orbit-mvi, the syntax is easier to read, doesnât require implementing interfaces all over the place and above all you can use it within a standard jetpack viewmodel so @HiltViewModel simply works, no complicated or messy setup. The feature set isnât identical to Mavericks so youâll have to judge for yourself if it meets your needs.