Skip to content

Instantly share code, notes, and snippets.

@mitchtabian
Created July 3, 2020 18:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mitchtabian/55cb572670aedf6f9045a392fdb68c63 to your computer and use it in GitHub Desktop.
Save mitchtabian/55cb572670aedf6f9045a392fdb68c63 to your computer and use it in GitHub Desktop.
Hilt @provide an interface instance that you do NOT own
@Module
@InstallIn(ApplicationComponent::class)
object NetworkModule {
@Singleton
@Provides
fun provideBlogService(): BlogService{
return Retrofit.Builder()
.baseUrl("https://open-api.xyz/placeholder/")
.build()
.create(BlogService::class.java)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment