Last active
July 23, 2019 15:33
-
-
Save manuelvicnt/85489d8571082bd4eac54bb0872df87a to your computer and use it in GitHub Desktop.
Static @provides in different Dagger modules
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
@Module(includes = [OkHttpClientModule::java]) | |
abstract class NetworkModule { | |
@Binds abstract fun provideService(retrofitService: RetrofitService): Service | |
} | |
@Module | |
object OkHttpClientModule { | |
@JvmStatic | |
@Provides | |
fun provideOkHttpClient(): OkHttpClient { | |
return OkHttpClient.Builder().build() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment