Created
September 4, 2021 17:20
-
-
Save devDeejay/263f75c68399ca483aa212bf83786bac to your computer and use it in GitHub Desktop.
This file contains 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
// Hilt Module | |
// @InstallIn <-- We define the component (See Hilt Components for more) | |
// This helps Hilt knows how long these dependencies have to stay in the memory | |
// But We use the Application level component for this example | |
// So NetworkRepo() will stay as long as Application is running. | |
@InstallIn(ActivityComponent::class) | |
@Module | |
abstract class NetworkRepoModule { | |
@ActivityScoped | |
@Binds | |
abstract fun bindNetworkRepo(networkRepoImpl: NetworkRepoImpl): NetworkRepo | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment