Closed sergeshustoff closed 1 week ago
You need to add the interface as super type:
interface Base
@CustomScope
@Inject
class Impl : Base
interface BindingsComponent {
@Provides
fun bind(impl: Impl): Base = impl
}
@CustomScope
@Component
abstract class MainComponent : BindingComponent {
abstract fun base(): Base
}
This should work.
That works, thanks)
Case: Let's say we have a huge app with bloated components and a lot of implementation to interface bindings. When using dagger those bindings are usually extracted to a module. In case of kotlin-inject those bindings have to stay in the controller and bloat it even more.
Solution: Extract bindings to separate component? But that doesn't seem to work