Hello, is there a guideline how to use `launchInHi...
# dagger
g
Hello, is there a guideline how to use
launchInHiltContainer
from the
architecture-samples
with ViewModels that have an @AssistedFactory ?
Found the solution, leaving it here if someone else needs this too
Copy code
inline fun <reified T: ViewModel> launchInAssistedHiltContainer(noinline factory: () -> ViewModelProvider.Factory, crossinline block: (T) -> Unit) = run {
    launchFragmentInHiltContainer<EmptyFragment>().onFragment {
        val viewModel = it.viewModels<T>(
            factoryProducer = factory
        )
        block(viewModel.value)
    }
}