diff options
Diffstat (limited to 'src/stores/mangaLastPrune.ts')
| -rw-r--r-- | src/stores/mangaLastPrune.ts | 14 |
1 files changed, 14 insertions, 0 deletions
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<string>( + browser ? localStorage.getItem('mangaLastPrune') ?? '' : '' +); + +mangaLastPrune.subscribe((value) => { + if (browser) { + localStorage.setItem('mangaLastPrune', value); + } +}); + +export default mangaLastPrune; |