android / codelab-android-datastore

Apache License 2.0
228 stars 105 forks source link

[Codelab] Data type & variable names don't match in codelab #30

Closed anidhamal closed 2 years ago

anidhamal commented 3 years ago

In codelab's Chapter 6: Persisting data in Preferences DataStore

class UserPreferencesRepository(
    private val userPreferencesStore: DataStore<UserPreferences>,
    ...
) { ... }
  1. There is no way to pass DataStore<UserPreferences> through delegate. This needs to be updated to DataStore<Preferences>
  2. It doesn't mention where updateShowCompleted & userPreferencesFlow should be added. These method/variable make use of dataStore so feels like they belong in TasksActivity. maybe it's confusing because variable name used in UserPreferencesRepository as userPreferencesStore.
mmoczkowski commented 2 years ago

Thanks, the function signature has been updated