From 0cdabbef2a6f5f4ff569cab4c2789a380773db52 Mon Sep 17 00:00:00 2001 From: Sean Lynch Date: Tue, 15 Aug 2023 13:04:08 -0400 Subject: [PATCH] Cleanup --- src/lib/stores/localStore.ts | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/lib/stores/localStore.ts b/src/lib/stores/localStore.ts index c7ace3bea..deb0ce4e8 100644 --- a/src/lib/stores/localStore.ts +++ b/src/lib/stores/localStore.ts @@ -6,12 +6,6 @@ import { expireObject } from '../utils/object'; import type { Expiry } from '../utils/object'; import { browser } from '../utils/env'; -// https://stackoverflow.com/questions/56488202/how-to-persist-svelte-store -// https://github.com/joshnuss/svelte-local-storage-store/blob/master/src/index.js -// https://github.com/andsala/svelte-persistent-store/blob/master/src/generator.ts -// https://github.com/sbcs-chh/app-finance/blob/develop/Finance.Web/ClientApp/src/hooks/LocalStorage.tsx -// https://developer.mozilla.org/en-US/docs/Learn/Tools_and_testing/Client-side_JavaScript_frameworks/Svelte_stores#implementing_our_custom_todos_store - type LocalStoreOptions = { expiry?: Expiry | ((previousExpiry: Expiry | undefined | null) => Expiry); override?: Value; @@ -28,9 +22,8 @@ function localStore(key: string, initialValue: Value, options?: LocalStor if (storedValue !== null) { const decodedValue = parse(storedValue); if (options?.expiry) { - // TODO: if object returned, merge with initialValue (sub-properties)? + // TODO: If object returned, merge with initialValue (sub-properties)? value = expireObject(decodedValue.value, decodedValue.expiry) ?? initialValue; - previousExpiry = decodedValue.expiry; } else { value = decodedValue;