You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
546 B
22 lines
546 B
import { writable } from "svelte/store";
|
|
|
|
const localLoad = (key: string, def: any) =>
|
|
('__pee__' + key) in localStorage
|
|
? JSON.parse(localStorage.getItem('__pee__' + key)!)
|
|
: def;
|
|
|
|
const localSet = (key: string, value: any) =>
|
|
localStorage.setItem('__pee__' + key, JSON.stringify(value));
|
|
|
|
export const settings = writable(localLoad('settings', {
|
|
apv: false,
|
|
xpv: false,
|
|
xpi: false,
|
|
apa: false,
|
|
blacklist: [],
|
|
sources: []
|
|
}));
|
|
|
|
settings.subscribe(newVal => {
|
|
localSet('settings', newVal);
|
|
});
|
|
|