Formalize the to/from Store rules for UserStore (#2708)

- Explicitly don't save to disk if the value in the store is the same as
  the default. That way we can change the defaults between versions

- Calculate the PreferencesModel on demand

- In the future, when we turn on strict null checking, we can enforce
  that the UserStore expects the correct types too

Signed-off-by: Sebastian Malton <sebastian@malton.name>

simplify default check, remove defaults from UserStore

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton authored and GitHub committed 2021-07-06 09:14:13 -04:00
1 parent baef6944aa
commit c4623c424d
5 files changed
+315 -99

No files matched your search

+1
View File
@@ -46,6 +46,7 @@ export interface ThemeItems extends Theme {
}
export class ThemeStore extends Singleton {
static readonly defaultTheme = "lens-dark";
protected styles: HTMLStyleElement;
// bundled themes from `themes/${themeId}.json`