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