// define your stores import { writable } from './localStorageStore' // `preferences` will be: // - Synced with localStorage // - Accessible via pub/sub export const preferences = writable('preferences', { theme: 'dark', pane: '50%', ... }) // then when you want to use the store import { get } from 'svelte/store' import { preferences } from './stores' preferences.subscribe(...) // subscribe to changes preferences.update(...) // update value preferences.set(...) // set value get(preferences) // read value $preferences // read value with automatic subscription