Created
August 10, 2021 15:30
-
-
Save vaibhavgoyal09/6b369d7f071daec8b323f35e7851a36c to your computer and use it in GitHub Desktop.
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
override suspend fun putString(key: String, value: String) { | |
val preferencesKey = stringPreferencesKey(key) | |
context.dataStore.edit { preferences -> | |
preferences[preferencesKey] = value | |
} | |
} | |
override suspend fun putInt(key: String, value: Int) { | |
val preferencesKey = intPreferencesKey(key) | |
context.dataStore.edit { preferences -> | |
preferences[preferencesKey] = value | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment