aboutsummaryrefslogtreecommitdiff
path: root/src/stores/chaptersLastPrune.ts
blob: bccee23e4c9e1a589d28e59b25d4326e502e6fc3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import { browser } from '$app/environment';
import { writable } from 'svelte/store';

const chaptersLastPrune = writable<string>(
	browser ? localStorage.getItem('chaptersLastPrune') ?? '' : ''
);

chaptersLastPrune.subscribe((value) => {
	if (browser) {
		localStorage.setItem('chaptersLastPrune', value);
	}
});

export default chaptersLastPrune;