I have component graph of ```App -> User |_-> R...
# dagger
u
I have component graph of
Copy code
App -> User
  |_-> RegistrationFlow
i..e user na registration are children of app, but don't see each other. There is a dependency
Foo
that only needs dependencies from
App
component, so it's injectable in bot
User
and
RegFlow
, however I want to cache it per child scope. i.e instance1 in
User
and instance2 in
RegistrationFlow
as it is stateful. Is this possible? Other than not having
@Inject
on Foo and having 2 module
@Provides
functions Basically I want
Copy code
@User
@RegistarationFlow
class Foo @Inject constructor(..)
but compiler complains
n
To be honest I don’t really understand you message. But based on last code sample seems like you want to have 2 scopes with constructor injection and it’s not possible.
u
Shame, as it would be possible with
@Provides
.. I think...
n
yes you basically need 2 modules, each one will be attached to different component and each one will provide Foo with different scope