I can't find a GitHub source for the tutorial webpage, but the tutorial examples are available in this repo so I will flag this issue here, though note that it is an issue of the tutorial webpage and not of the dagger library.
At the Deposit After Login section, it is mentioned to
We need to include UserCommandsRouter.InstallationModule in our @Component annotation
which is followed by the code.
@Singleton
@Component(
modules = {
...
UserCommandsRouter.InstallationModule.class,
})
interface CommandProcessorFactory {
CommandProcessor commandProcessor();
}
Note that at this step, UserCommandsModule should also be removed from the modules of this Component, so it's suggested to show all of the modules and clarify that UserCommandsModule is removed
@Singleton
@Component(
modules = {
LoginCommandModule.class,
HelloWorldModule.class,
SystemOutModule.class, // UserCommandsModule.class is removed
UserCommandsRouter.InstallationModule.class
})
interface CommandProcessorFactory {
CommandProcessor commandProcessor();
}
Otherwise the build fails. Currently, the sentence saying this code movement is too subtle and nested inside the explanations:
The @Subcomponent annotation defines what modules Dagger should know about when creating instances for this subcomponent only. Just like @Component, it can take a list of modules: we’ve moved the UserCommandsModule that declares our DepositCommand here.
I can't find a GitHub source for the tutorial webpage, but the tutorial examples are available in this repo so I will flag this issue here, though note that it is an issue of the tutorial webpage and not of the dagger library.
At the Deposit After Login section, it is mentioned to
which is followed by the code.
Note that at this step,
UserCommandsModuleshould also be removed from themodulesof thisComponent, so it's suggested to show all of the modules and clarify thatUserCommandsModuleis removedOtherwise the build fails. Currently, the sentence saying this code movement is too subtle and nested inside the explanations: