From b89d0e7dada186e31be37e62a7a75efc2dbe9c99 Mon Sep 17 00:00:00 2001 From: Fuwn Date: Sat, 26 Aug 2023 22:29:03 -0700 Subject: feat: initial build --- src/stores/lastPruneAt.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 src/stores/lastPruneAt.ts (limited to 'src/stores/lastPruneAt.ts') diff --git a/src/stores/lastPruneAt.ts b/src/stores/lastPruneAt.ts new file mode 100644 index 00000000..0720bc60 --- /dev/null +++ b/src/stores/lastPruneAt.ts @@ -0,0 +1,12 @@ +import { browser } from '$app/environment'; +import { writable } from 'svelte/store'; + +const lastPruneAt = writable(browser ? localStorage.getItem('lastPruneAt') ?? '' : ''); + +lastPruneAt.subscribe((value) => { + if (browser) { + localStorage.setItem('lastPruneAt', value); + } +}); + +export default lastPruneAt; -- cgit v1.2.3