import { writable } from 'svelte/store'; import { v4 as uuidv4 } from 'uuid'; let { update, set, subscribe } = writable([]); const addTask = (taskInput: Omit) => update((tasks) => { const task = { ...taskInput, id: uuidv4() }; return [...tasks, task]; }); export default { update, set, subscribe, addTask };