Skip to content

Instantly share code, notes, and snippets.

@romainbsl
Created June 20, 2020 14:53
Show Gist options
  • Select an option

  • Save romainbsl/a3e1f42ceeb2cf3fb5c346d59cc6a3e4 to your computer and use it in GitHub Desktop.

Select an option

Save romainbsl/a3e1f42ceeb2cf3fb5c346d59cc6a3e4 to your computer and use it in GitHub Desktop.
@ThreadLocal
object CommonInjector {
val kodeinContainer = DI.lazy {
importAll(databaseModule, loginModule, participantModule)
}
// Direct access to the presenters
fun participantListPresenter() = kodeinContainer.direct.instance<ParticipantList.Presenter>()
fun participantCreationPresenter() = kodeinContainer.direct.instance<ParticipantCreation.Presenter>()
fun voteCreationPresenter() = kodeinContainer.direct.instance<VoteCreation.Presenter>()
fun photoUploadPresenter() = kodeinContainer.direct.instance<PhotoUpload.Presenter>()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment