Summary
User preferences such as preferred sort order on the creator list need to persist across page reloads. A shared localStorage helper with typed get and set functions should be the single place this read/write logic lives, avoiding raw localStorage calls scattered across components.
Scope
- Add
getPreference<T>(key: string, defaultValue: T): T and setPreference<T>(key: string, value: T): void helpers
- Handle JSON serialization and deserialization internally
- Return the
defaultValue silently if the key is missing or JSON parsing fails
- Add unit tests for: key present, key missing returns default, malformed JSON returns default
Acceptance Criteria
ETA: 12 hours
Coordinate on Telegram
Summary
User preferences such as preferred sort order on the creator list need to persist across page reloads. A shared localStorage helper with typed get and set functions should be the single place this read/write logic lives, avoiding raw
localStoragecalls scattered across components.Scope
getPreference<T>(key: string, defaultValue: T): TandsetPreference<T>(key: string, value: T): voidhelpersdefaultValuesilently if the key is missing or JSON parsing failsAcceptance Criteria
ETA: 12 hours
Coordinate on Telegram