Created
December 29, 2022 10:08
-
-
Save srikrishnasakunia/edacd7d81bb121c834316e7fc7f24089 to your computer and use it in GitHub Desktop.
This interface will consist of all our functions which will be implemented in our Helper class.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.datastoretest.data.local | |
import androidx.datastore.preferences.core.Preferences | |
import kotlinx.coroutines.flow.Flow | |
interface IPreferenceDataStoreAPI { | |
suspend fun <T> getPreference(key: Preferences.Key<T>,defaultValue: T):Flow<T> | |
suspend fun <T> getFirstPreference(key: Preferences.Key<T>,defaultValue: T):T | |
suspend fun <T> putPreference(key: Preferences.Key<T>,value:T) | |
suspend fun <T> removePreference(key: Preferences.Key<T>) | |
suspend fun <T> clearAllPreference() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment