aboutsummaryrefslogtreecommitdiff
path: root/src/stores/roundDownChapters.ts
blob: 8cbdbdc1a31862db3fb45f297b7059ea0cdc11f7 (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 roundDownChapters = writable<string>(
	browser ? localStorage.getItem('roundDownChapters') ?? 'true' : 'true'
);

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

export default roundDownChapters;