hi guys, good evening! is there a was to have two ...
# dagger
e
hi guys, good evening! is there a was to have two modules using
Copy code
@InstallIn(ApplicationComponent::class)
@Module
abstract class ViewModelModule1 {
    @Binds
    @IntoMap
    @ViewModelKey(VM1::class)
    abstract fun bindVM1(vm1: VM1): ViewModel
}

@InstallIn(ApplicationComponent::class)
@Module
abstract class ViewModelModule2 {
    @Binds
    @IntoMap
    @ViewModelKey(VM2::class)
    abstract fun bindVM2(vm2: VM2): ViewModel
}
and merge them to inject them as a single map in a constructor like
Copy code
@Inject constructor(private val creators: Map<Class<out ViewModel>, @JvmSuppressWildcards Provider<ViewModel>>)
I’m trying to use hilt and when I
Copy code
@InstallIn(ApplicationComponent::class)
in both modules above I have an error message saying that the map dependency is duplicated. In advance thanks!