android / codelab-android-datastore

Apache License 2.0
227 stars 105 forks source link

DataStore<Preferences> #56

Closed nynganini closed 2 years ago

nynganini commented 2 years ago

When creating UserPreferencesRepository the type should be DataStore\<Preferences> instead of DataStore\<UserPreferences>

coodin commented 2 years ago

I have encounter the same problem so I decided to look the finished repository to check how they have done that and they have also written DataStore inside UserPreferencesRepository which is same with your answer.

ccornici commented 2 years ago

Looks like they just write code in notepad and commit it, and never correct it either.

donnfelker commented 2 years ago

These kind of mistakes can (and do) throw beginners off the wagon really easily. This should be fixed ASAP.

Offending page: https://developer.android.com/codelabs/android-preferences-datastore#5

mmoczkowski commented 2 years ago

Thanks, I agree this needs to be fixed asap. Working on it.

mmoczkowski commented 2 years ago

Closing as a duplicate of #45