diff options
author | metamuffin <metamuffin@disroot.org> | 2022-09-16 21:20:52 +0200 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2022-09-16 21:20:52 +0200 |
commit | 52b7bf7a052d2da6c71db7695dde73716cb0e4e5 (patch) | |
tree | bd582773a2d60e54286c450bc9595b398d76582d /client-web/source/preferences/mod.ts | |
parent | a3cc9f8fb1bf45741b08ce6d383c4d7cc8ea8b1f (diff) | |
download | keks-meet-52b7bf7a052d2da6c71db7695dde73716cb0e4e5.tar keks-meet-52b7bf7a052d2da6c71db7695dde73716cb0e4e5.tar.bz2 keks-meet-52b7bf7a052d2da6c71db7695dde73716cb0e4e5.tar.zst |
optional streams (3, less bugs)
Diffstat (limited to 'client-web/source/preferences/mod.ts')
-rw-r--r-- | client-web/source/preferences/mod.ts | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/client-web/source/preferences/mod.ts b/client-web/source/preferences/mod.ts index ecff8fa..f4fa551 100644 --- a/client-web/source/preferences/mod.ts +++ b/client-web/source/preferences/mod.ts @@ -18,7 +18,7 @@ type TypeMapper = { "string": string, "number": number, "boolean": boolean } type PrefMap<T extends { [key: string]: { type: unknown } }> = { [Key in keyof T]: T[Key]["type"] } type Optional<T extends { [key: string]: unknown }> = { [Key in keyof T]?: T[Key] } export const { prefs: PREFS, explicit: PREFS_EXPLICIT } = register_prefs(PREF_DECLS) -const pref_change_handlers: Map<keyof typeof PREFS, Map<() => unknown>> = new Map() +const pref_change_handlers: Map<keyof typeof PREFS, Set<() => unknown>> = new Map() export const on_pref_changed = (key: keyof typeof PREFS, cb: () => unknown): (() => void) => { const m = (pref_change_handlers.get(key) ?? (() => { |