ragdroid / Dahaka

Demo project for Dagger 2
Apache License 2.0
207 stars 35 forks source link

Scope question #18

Open SivarajSubramanian1 opened 6 years ago

SivarajSubramanian1 commented 6 years ago

Great example, but is that correct to inject the activityInjector() from user manager in the application class.

@Override
    public AndroidInjector<Activity> activityInjector() {
        return userManager.activityInjector();
    }

In case of multiple sub components, should we not use the injector from the manager which built the component for that scoped activity. In this example login should have used the application component injector and the home activity could use the android injector from user manager.

darrillaga commented 5 years ago

Same question here, It seems UserManager injector is always used, when initially injected it should pick the application one, after login it seems it switch to the user manager injector, but then when logout there is no switch to application again, so it seems the next Login Activity will be injected from User scope instead from application one.

I'm trying to start using this structure so It would be awesome having a response on this.

Thanks for awesome work! @ragdroid