Skip to content

Commit

Permalink
Hide Dagger's implementation details behind GeneratedComponents.kt
Browse files Browse the repository at this point in the history
  • Loading branch information
kingsleyadio committed Jan 10, 2022
1 parent 05eb985 commit 2b64869
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package com.deliveryhero.whetstone

import com.deliveryhero.whetstone.component.ApplicationComponent
import com.deliveryhero.whetstone.component.ApplicationComponentFactory
import com.deliveryhero.whetstone.scope.ApplicationScope
import com.squareup.anvil.annotations.MergeComponent
import dagger.Component
import javax.inject.Singleton

// DO NOT CHANGE THIS FILE.
//
Expand All @@ -13,8 +13,11 @@ import dagger.Component

@MergeComponent(ApplicationScope::class)
@SingleIn(ApplicationScope::class)
@Singleton
public interface GeneratedApplicationComponent : ApplicationComponent {

@Component.Factory
public interface Factory : ApplicationComponentFactory
public interface Factory : ApplicationComponent.Factory

public companion object Default: Factory by DaggerGeneratedApplicationComponent.factory()
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class MainApplication : Application(), ApplicationComponentOwner {
internal lateinit var dependency: MainDependency

override val applicationComponent: ApplicationComponent =
DaggerGeneratedApplicationComponent.factory().create(this)
GeneratedApplicationComponent.create(this)

override fun onCreate() {
Whetstone.inject(this)
Expand Down

0 comments on commit 2b64869

Please sign in to comment.