live_svelte/example_project/assets/svelte/sharedStore.ts
Denis Donici af0c4ccf82
Update installation instructions. Fix igniter installer (#210)
* format test config

* chore: changed name for store file

* updated vite in example project

* chore: fix manual install instructions

* chore: updated instructions and examples in readme

* chore: fix igniter installer

* chore: fix igniter installer tests. update guides
2026-04-10 00:49:29 +03:00

7 lines
363 B
TypeScript

import {writable, derived} from "svelte/store"
// Shared writable store — a module singleton.
// Every component that imports this gets the exact same store instance,
// so any write is immediately visible in all subscribers across the page.
export const sharedCount = writable(0)
export const sharedCountIsOdd = derived(sharedCount, count => count % 2 === 1)