Created
April 8, 2019 09:16
-
-
Save tfcporciuncula/5f6c5d2c3e02ff8cc5c100035fd4a515 to your computer and use it in GitHub Desktop.
BookInjection.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Subcomponent | |
interface BookComponent { | |
@Subcomponent.Factory | |
interface Factory { | |
fun create(@BindsInstance bookView: BookView): BookComponent | |
} | |
val presenter: BookPresenter | |
} | |
@Component(modules = ...) | |
interface ApplicationComponent { | |
... | |
val bookComponentFactory: BookComponent.Factory | |
} | |
// and in the Activity | |
private val presenter = | |
MyApplication | |
.component | |
.bookComponentFactory | |
.create(this) | |
.presenter |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment