Global vs. Component State in Vuex
summary
Checklist-style rules and concrete examples decide where state lives: use Vuex store for data with a single instance or that changes from multiple places (example: a globally committed alert level), keep per-component data local when each component needs its own copy (example: an open flag per engine that otherwise opens every engine), compute derived values from base state (assigned crew member derived from crew array), and follow code examples that show commits and local props.
AI-written summary · about
chapters (9)
- 0:00Introduction
- 0:35Two States: Local & Global
- 1:18Will this piece of data be the same across the entire app?
- 2:08Will this piece of data be used across more than one component?
- 2:31Is this piece of data generated based on other data in the application?
- 2:50Will this piece of data be used in a component that renders multiple times?
- 3:26Will the date be changed from multiple places?
- 4:00Belongs in Global State
- 4:23Belongs in Component State








