doxa-maps/library/stores/README.md
Doxa Maps e19697673d
Some checks are pending
Deploy to GitHub Pages / build (push) Waiting to run
Deploy to GitHub Pages / deploy (push) Blocked by required conditions
Doxa Maps — the map bundler, 7 production plugins and the Experimental shelf
2026-09-25 20:07:59 +00:00

15 lines
905 B
Markdown

# library/stores/ — per-instance Pinia stores
Three stores, one responsibility each. Created fresh per `<doxa-map>` element and provided to
descendants from `ProfileLoader.vue` — reach them via `inject()`, never a direct `useXxxStore()`
import (LL-010, LL-023).
| File | Owns | Example fields |
|---|---|---|
| `mapStore.js` | Map state: selections, zoom, bbox, Mapbox instances | `selectedRegion`, `selectedFamily`, `maps[mapId]`, `activeMapId` |
| `uiStore.js` | UI state: sidebar, tabs, theme, toasts, modals | `activeTab`, `sidebarCollapsed`, `theme`, `legendState` |
| `dataStore.js` | Data caching: GeoJSON (markRaw), fetch status, errors | `sources[sourceId]`, `loadingStates[sourceId]` |
- Use `markRaw()` on large GeoJSON — Vue should not deeply proxy it.
- Keep state changes in named actions; stores don't import each other (cross-store coordination
happens at the component level).