aboutsummaryrefslogtreecommitdiff
path: root/src/stores/manga.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/stores/manga.ts')
-rw-r--r--src/stores/manga.ts12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/stores/manga.ts b/src/stores/manga.ts
new file mode 100644
index 00000000..74e3f95a
--- /dev/null
+++ b/src/stores/manga.ts
@@ -0,0 +1,12 @@
+import { browser } from '$app/environment';
+import { writable } from 'svelte/store';
+
+const manga = writable<string>(browser ? localStorage.getItem('manga') ?? '' : '');
+
+manga.subscribe((value) => {
+ if (browser) {
+ localStorage.setItem('manga', value);
+ }
+});
+
+export default manga;