Time to apply all Pinia knowledge in one project! You'll build a complete NOVA LAB station resource management system that uses:
1stores/
2βββ resources.js # Station resources (state, getters, actions)
3βββ alerts.js # Alert system (subscribe to resources)1ResourceStore (state: oxygen, water, energy)
2 βββ getters β statusLevel, criticalResources, summary
3 βββ actions β consume(), refill(), emergencyProtocol()
4 βββ $subscribe β AlertStore.checkLevels()
5
6AlertStore (state: alerts)
7 βββ getters β activeAlerts, criticalCount
8 βββ actions β addAlert(), dismissAlert()Analyze the working system in the editor. Pay attention to:
Key patterns:
ref() and computed()storeToRefs for reactive destructuring$patch for batch state updates