aboutsummaryrefslogtreecommitdiff
path: root/src/stores/cacheMangaMinutes.ts
diff options
context:
space:
mode:
authorFuwn <[email protected]>2023-08-26 22:29:03 -0700
committerFuwn <[email protected]>2023-08-26 22:29:03 -0700
commitb89d0e7dada186e31be37e62a7a75efc2dbe9c99 (patch)
tree8c9f6b5d7aa0f709c06d5eb45fbf763883b21c89 /src/stores/cacheMangaMinutes.ts
downloaddue.moe-b89d0e7dada186e31be37e62a7a75efc2dbe9c99.tar.xz
due.moe-b89d0e7dada186e31be37e62a7a75efc2dbe9c99.zip
feat: initial build
Diffstat (limited to 'src/stores/cacheMangaMinutes.ts')
-rw-r--r--src/stores/cacheMangaMinutes.ts14
1 files changed, 14 insertions, 0 deletions
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<string>(
+ browser ? localStorage.getItem('cacheMangaMinutes') ?? '120' : '120'
+);
+
+cacheMangaMinutes.subscribe((value) => {
+ if (browser) {
+ localStorage.setItem('cacheMangaMinutes', value);
+ }
+});
+
+export default cacheMangaMinutes;