summaryrefslogtreecommitdiffhomepage
path: root/.dispatch/rules/frontend-no-ambient-state.md
blob: 663bf1a6395a5cf7dc31cd1b3bf9c69b728b2592 (plain)
1
2
3
4
5
6
7
# Rule: no ambient state (frontend)

State is owned per-unit and passed explicitly. NO module-global mutable store
reached from everywhere — that is the old FE's "tools leak across tabs" /
"model resets on tab switch" bug class. Svelte runes (`$state`) are a THIN
reactive wrapper over a pure reducer, never the home of logic. Subscriptions are
owned and disposed on unmount (no orphaned or duplicate subscriptions).