1
0
mirror of https://github.com/comatory/fb2iCal synced 2025-06-05 22:09:25 +02:00
Files
Facebook-Events-iCal-Converter/lib/frontend/stores/configStore.js
2020-12-15 21:49:15 +01:00

25 lines
473 B
JavaScript

import { writable } from 'svelte/store'
const createConfigStore = () => {
const state = JSON.parse(localStorage.getItem('fb-to-ical-config') || '{}')
const { subscribe, set, update } = writable(state)
const setValue = (key, value) => {
update((prevState) => ({ ...prevState, [key]: value }))
}
const getState = () => state
return {
...state,
subscribe,
set,
update,
setValue,
getState,
}
}
export default createConfigStore()