Work with Hilt with submodules of a feature module

224 Views Asked by At

Is there any way to make dagger hilt work with clean architecture that uses the presentation-domain-data as submodules?

For example I have Feature A as a module. This module has 3 submodules:

  1. Presentation module
  2. Domain module
  3. Data module

How could I provide the needed dependencies for every submodule? If I create a DI module (Another layer) then I'll need have them 3 submodules as a dependency and somehow I must return these dependencies and I'm not able to do that because that creates a circular dependency (At least that's what I think)

  • DI -> Domain -> DI
  • DI -> Data -> DI
  • DI -> Presentation -> DI

Also I'm breaking the rule "Domain should not depend on any module"

0

There are 0 best solutions below