@Single
class Item1(
@InjectedParam private val xpto: MyClass, <<<<
)
@Single
class MyComponent(
@InjectedParam private val xpto: MyClass, <<<<
private val item1: Item1
)
Yeah... but I think this is not making sense... The idea it will replace/reuse the same injection (equal to both classes).
I avoid it right now moving to a function and invoking the dependency inside this function.
Pedro Francisco de Sousa Neto
03/08/2024, 9:03 PM
Other question, how can I do this in constructor level?
Pedro Francisco de Sousa Neto
03/08/2024, 9:04 PM
Something like:
Copy code
@Factory
internal class Repository(
@Named("mock-remote") private val mock: Mock
): RemoteDataSource