mirror of
https://github.com/smartyellow/status.git
synced 2025-01-18 21:47:58 +00:00
22 lines
480 B
JavaScript
22 lines
480 B
JavaScript
import { get, writable } from 'svelte/store';
|
|
import App from './app.svelte';
|
|
|
|
new App({ target: document.body });
|
|
|
|
function createSettingsStore() {
|
|
const s = writable(0);
|
|
|
|
function updateStorage(val) {
|
|
window.localStorage.setItem('statusdash', JSON.stringify(val));
|
|
s.set(val);
|
|
}
|
|
|
|
return {
|
|
subscribe: s.subscribe,
|
|
set: val => updateStorage(val),
|
|
update: val => updateStorage({ ...get(s), val }),
|
|
};
|
|
}
|
|
|
|
export const settings = createSettingsStore();
|