Dagger2: @Component.Factory and @SubComponent.Factory

New way to bind instances to your component.

Photo by Cassie Boca on Unsplash

Approach 1: Modules with constructor arguments:

Approach 2: @Component.Builder:

Approach 3: The winner @Component.Factory

Android | Kotlin | Java