-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLocalDataSourceModule.kt
More file actions
37 lines (32 loc) · 1.4 KB
/
LocalDataSourceModule.kt
File metadata and controls
37 lines (32 loc) · 1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package com.sopt.clody.di
import android.content.SharedPreferences
import com.sopt.clody.data.datastore.TokenDataStore
import com.sopt.clody.data.datastore.TokenDataStoreImpl
import com.sopt.clody.data.local.datasource.AppReviewLocalDataSource
import com.sopt.clody.data.local.datasource.FirstDraftLocalDataSource
import com.sopt.clody.data.local.datasourceimpl.AppReviewLocalDataSourceImpl
import com.sopt.clody.data.local.datasourceimpl.FirstDraftLocalDataSourceImpl
import com.sopt.clody.di.qualifier.FirstDraftPrefs
import com.sopt.clody.di.qualifier.ReviewPrefs
import com.sopt.clody.di.qualifier.TokenPrefs
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import javax.inject.Singleton
@Module
@InstallIn(SingletonComponent::class)
object LocalDataSourceModule {
@Provides
@Singleton
fun provideTokenDataStore(@TokenPrefs sharedPreferences: SharedPreferences): TokenDataStore =
TokenDataStoreImpl(sharedPreferences)
@Provides
@Singleton
fun provideFirstDraftLocalDataSource(@FirstDraftPrefs sharedPreferences: SharedPreferences): FirstDraftLocalDataSource =
FirstDraftLocalDataSourceImpl(sharedPreferences)
@Provides
@Singleton
fun provideAppReviewLocalDataSource(@ReviewPrefs sharedPreferences: SharedPreferences): AppReviewLocalDataSource =
AppReviewLocalDataSourceImpl(sharedPreferences)
}