Skip to content

Instantly share code, notes, and snippets.

@cp-hardik-p
Last active August 29, 2022 10:32
Show Gist options
  • Save cp-hardik-p/b7dc4391d35b0857b180c54e6440ea55 to your computer and use it in GitHub Desktop.
Save cp-hardik-p/b7dc4391d35b0857b180c54e6440ea55 to your computer and use it in GitHub Desktop.
suspend fun storeUserInfo(age: Int, name: String) {
context.dataStore.edit { preferences ->
preferences[USER_AGE_KEY] = age
preferences[USER_NAME_KEY] = name
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment