Jul 23, 2017 · 1 min read
By the way, you can have Dagger create the GameSession automatically. Instead of injecting the session just have the GameComponent interface return a method with a GameSession object.
@Component(modules = GameModule.class)
interface GameComponent {
GameSession session();
}
Then you can get the session from Dagger.
GameSession session = DaggerGameComponent.builder().build().session();
