Open NickvanDyke opened 5 years ago
How about assisted injection? https://youtu.be/9fn5s8_CYJI?t=2080
I don't use Dagger myself, but something @Zhuinden mentioned should be possible I guess? Doesn't Dagger support such a thing out of the box? 🤔
This is one thing we do encounter by the way, dealing with clean dependency injection. You can create really nice dependency scopes, but it may cause a fair bit of wiring to set everything up (we do DI manually).
What @Zhuinden linked works well, thanks guys. Wasn't able to find it with my own googling
Nice! Something like this might fit in the documentation :+1:
Is this possible? How would we tell Dagger what to inject for the Scene's
savedState
constructor parameter? For the time being I have switched to using Koin since with that I can locate the Scene's dependencies, and pass those and the savedState into the Scene's constructor manually.To be clear, what I'm looking to be able to do is annotate my Scene with
@Inject
, and then either retrieve it throughappComponent.getSomeSpecificScene()
or let Dagger inject it into other classes. In both scenarios, the Scene is constructed entirely by Dagger.