Skip to content

Commit

Permalink
Fix Dagger use object for Provides
Browse files Browse the repository at this point in the history
  • Loading branch information
ksharma-xyz committed Sep 18, 2024
1 parent 9e6c4c4 commit 5f04840
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,16 @@ import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import retrofit2.Retrofit
import xyz.ksharma.krail.network.di.NetworkModule
import xyz.ksharma.krail.trip_planner.network.api.service.TripPlanningService
import javax.inject.Singleton

@Module
@InstallIn(SingletonComponent::class)
interface ServiceModule {
object ServiceModule {

@Provides
@Singleton
fun provideTripPlanningService(retrofit: Retrofit): TripPlanningService {
return NetworkModule.service(retrofit, TripPlanningService::class.java)
return retrofit.create(TripPlanningService::class.java)
}
}

0 comments on commit 5f04840

Please sign in to comment.