@@ -6,11 +6,13 @@ import androidx.datastore.preferences.core.Preferences
66import androidx.datastore.preferences.preferencesDataStore
77import com.ninecraft.booket.core.datastore.api.datasource.BookRecentSearchDataSource
88import com.ninecraft.booket.core.datastore.api.datasource.LibraryRecentSearchDataSource
9+ import com.ninecraft.booket.core.datastore.api.datasource.NotificationDataSource
910import com.ninecraft.booket.core.datastore.api.datasource.OnboardingDataSource
1011import com.ninecraft.booket.core.datastore.api.datasource.TokenDataSource
1112import com.ninecraft.booket.core.datastore.impl.datasource.DefaultLibraryRecentSearchDataSource
1213import com.ninecraft.booket.core.datastore.impl.datasource.DefaultOnboardingDataSource
1314import com.ninecraft.booket.core.datastore.impl.datasource.DefaultBookRecentSearchDataSource
15+ import com.ninecraft.booket.core.datastore.impl.datasource.DefaultNotificationDataSource
1416import com.ninecraft.booket.core.datastore.impl.datasource.DefaultTokenDataSource
1517import dagger.Binds
1618import dagger.Module
@@ -27,11 +29,13 @@ object DataStoreModule {
2729 private const val BOOK_RECENT_SEARCH_DATASTORE_NAME = " BOOK_RECENT_SEARCH_DATASTORE"
2830 private const val LIBRARY_RECENT_SEARCH_DATASTORE_NAME = " LIBRARY_RECENT_SEARCH_DATASTORE"
2931 private const val ONBOARDING_DATASTORE_NAME = " ONBOARDING_DATASTORE"
32+ private const val NOTIFICATION_DATASTORE_NAME = " NOTIFICATION_DATASTORE"
3033
3134 private val Context .tokenDataStore by preferencesDataStore(name = TOKEN_DATASTORE_NAME )
3235 private val Context .bookRecentSearchDataStore by preferencesDataStore(name = BOOK_RECENT_SEARCH_DATASTORE_NAME )
3336 private val Context .libraryRecentSearchDataStore by preferencesDataStore(name = LIBRARY_RECENT_SEARCH_DATASTORE_NAME )
3437 private val Context .onboardingDataStore by preferencesDataStore(name = ONBOARDING_DATASTORE_NAME )
38+ private val Context .notificationDataStore by preferencesDataStore(name = NOTIFICATION_DATASTORE_NAME )
3539
3640 @TokenDataStore
3741 @Provides
@@ -60,6 +64,13 @@ object DataStoreModule {
6064 fun provideOnboardingDataStore (
6165 @ApplicationContext context : Context ,
6266 ): DataStore <Preferences > = context.onboardingDataStore
67+
68+ @NotificationDataStore
69+ @Provides
70+ @Singleton
71+ fun provideNotificationDataStore (
72+ @ApplicationContext context : Context ,
73+ ): DataStore <Preferences > = context.notificationDataStore
6374}
6475
6576@Module
@@ -89,4 +100,10 @@ abstract class DataStoreBindModule {
89100 abstract fun bindOnboardingDataSource (
90101 defaultOnboardingDataSource : DefaultOnboardingDataSource ,
91102 ): OnboardingDataSource
103+
104+ @Binds
105+ @Singleton
106+ abstract fun bindNotificationDataSource (
107+ defaultNotificationDataSource : DefaultNotificationDataSource ,
108+ ): NotificationDataSource
92109}
0 commit comments