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/animeLastPrune.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 src/stores/animeLastPrune.ts (limited to 'src/stores/animeLastPrune.ts') diff --git a/src/stores/animeLastPrune.ts b/src/stores/animeLastPrune.ts new file mode 100644 index 00000000..f2e747d1 --- /dev/null +++ b/src/stores/animeLastPrune.ts @@ -0,0 +1,14 @@ +import { browser } from '$app/environment'; +import { writable } from 'svelte/store'; + +const animeLastPrune = writable( + browser ? localStorage.getItem('animeLastPrune') ?? '' : '' +); + +animeLastPrune.subscribe((value) => { + if (browser) { + localStorage.setItem('animeLastPrune', value); + } +}); + +export default animeLastPrune; -- cgit v1.2.3