Commit 9739280 1 parent a3ec094 commit 9739280 Copy full SHA for 9739280
File tree 1 file changed +27
-0
lines changed
app/src/main/java/com/github/swent/echo/di
1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change
1
+ package com.github.swent.echo.di
2
+
3
+ import android.app.Application
4
+ import com.github.swent.echo.data.repository.IRepository
5
+ import com.github.swent.echo.data.repository.Repository
6
+ import com.github.swent.echo.data.repository.datasources.Cache
7
+ import com.github.swent.echo.data.repository.datasources.LocalDataSource
8
+ import com.github.swent.echo.data.repository.datasources.RemoteDataSource
9
+ import com.github.swent.echo.data.repository.datasources.Supabase
10
+ import dagger.Module
11
+ import dagger.Provides
12
+ import dagger.hilt.InstallIn
13
+ import dagger.hilt.components.SingletonComponent
14
+ import io.github.jan.supabase.SupabaseClient
15
+
16
+ @Module
17
+ @InstallIn(SingletonComponent ::class )
18
+ object RepositoryModule {
19
+
20
+ @Provides
21
+ fun provideRepository (application : Application , supabaseClient : SupabaseClient ): IRepository {
22
+ val localDataSource: LocalDataSource = Cache (application)
23
+ val remoteDataSource: RemoteDataSource = Supabase (supabaseClient)
24
+
25
+ return Repository (localDataSource, remoteDataSource)
26
+ }
27
+ }
You can’t perform that action at this time.
0 commit comments