Skip to content

State and Reactivity Management ​

These Accepted rules define how frontend state is owned, shared, initialized, and synchronized. The decisions apply across frameworks; Vue reactivity and Pinia are used as concrete examples, not as required tools.

Status ​

Accepted

Rules ​

RuleScope
Keep UI state local by defaultLocal state ownership; Vue APIs shown as examples
Assign state to the lowest responsible ownerState ownership hierarchy and escalation criteria
Use a store for genuinely shared stateWhen independent consumers need one shared state lifecycle
Load store data lazilyStore initialization, loading triggers, and loaded-state semantics
Deduplicate shared store fetchesCached results, concurrent requests, and retries
Separate stores from servicesReactive state lifecycle versus business/data operations

Core Principle ​

Keep UI state with its narrowest responsible owner. Promote it to a shared store only when independent parts of the application need the same state or lifecycle. Load shared data when required and let its owner coordinate loading.

These rules complement the component management rules and the front-end application structure.

You own what ships.