Skip to content

Instantly share code, notes, and snippets.

@marukami
Created August 5, 2019 07:45
Show Gist options
  • Save marukami/4b2d6f7c1218c5430125b8657c13831a to your computer and use it in GitHub Desktop.
Save marukami/4b2d6f7c1218c5430125b8657c13831a to your computer and use it in GitHub Desktop.
Nested Dagger Module
@Module(includes = [NetworkModule.OkHttpClientModule::class])
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