What else Dagger 2 injection provides?
Published in
3 min readOct 16, 2019
Many a times, we just use Dagger 2 to inject dependencies. But it could provides more than that. Take for example the below code
class Dependency @Inject constructor()
@Component
interface MainComponent {
fun inject(target: Target)
}
We think we could only get the Dependency
object injected. But it also could provides the Provider<Dependency>
and Lazy<Dependency>
.