From 7fc05993446392f5342815734a7a2e99cf63bddb Mon Sep 17 00:00:00 2001 From: Fuwn Date: Sun, 27 Aug 2023 17:22:40 -0700 Subject: feat: cache media --- src/stores/mangaLastPrune.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 src/stores/mangaLastPrune.ts (limited to 'src/stores/mangaLastPrune.ts') diff --git a/src/stores/mangaLastPrune.ts b/src/stores/mangaLastPrune.ts new file mode 100644 index 00000000..f6b40b02 --- /dev/null +++ b/src/stores/mangaLastPrune.ts @@ -0,0 +1,14 @@ +import { browser } from '$app/environment'; +import { writable } from 'svelte/store'; + +const mangaLastPrune = writable( + browser ? localStorage.getItem('mangaLastPrune') ?? '' : '' +); + +mangaLastPrune.subscribe((value) => { + if (browser) { + localStorage.setItem('mangaLastPrune', value); + } +}); + +export default mangaLastPrune; -- cgit v1.2.3