Vuex store:
- maintains a list of preferences
- has a USER_PREFERENCES_INIT action initializing all values
- has a USER_PREFERENCE_SET action that sets an individual preference value
- preferences is part of the user module state, a map of preference keys to values
DispatchingUserPreferenceRepository
- maintains a mapping of preferences to data sources and their configuration
- preferences are identified by a name
- preference persistence can be configured: currently the only way of doing so is via cookie
- exposes method(s) used by vuex user preference store actions
- is used during application initialization to set the vuex state accordingly
- cookie for our feature "wikibase-no-anonymouseditwarning"
Info:
- mw.cookie is an existing service to set and get cookies
- the current properties of the user state (name, primaryLanguage, secondaryLanguages) are not part of the preferences
We imagine something like the following to be the mapping of the DispatchingUserPreferenceRepository:
{ 'ignoreAnonWarning': new CookieUserPreferenceRepository( { ttl: 5000, cookieName: 'anon-warning-pref' }), 'licenceWarning': new FallbackUserPreferenceRepository( new CookieUserPreferenceRepository( ... ), new MWUserSettingPreferenceRepository( ... ) ), ... }