Created
September 5, 2022 06:10
-
-
Save meet30997/415a8f82577d4431086fa76fba0d648b to your computer and use it in GitHub Desktop.
DataStore StoreData
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
private val userNameKey = stringPreferencesKey("userNameKey") | |
suspend fun storeUserName(username: String): Preferences { | |
return dataStore.edit { myDataStore -> | |
myDataStore[userNameKey] = username | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment