xstate-store

Installation
SKILL.md

XState Store

Targets @xstate/store v4 and @xstate/store-react v2 (TypeScript 5.4+). Read the reference matched by the API or behavior being changed. Load adjacent references only for concerns the change crosses; reuse relevant context already read.

Pick the primitive first

State Primitive Why
Domain state updated through named events createStore({ context, on }) Typed trigger, can, emitted events, replayable transitions
Per-instance state built from input createStoreLogic({ context: (input) => … }) One definition, many instances; selectors come along
A single value set directly createAtom(value) No event vocabulary to justify a store
A value computed from other atoms or selectors createAtom(() => …) Read-only, recomputes on dependency change
Modes, guards, delays, hierarchical or parallel states xstate machine A store models data, not lifecycle

Done when: the primitive is chosen from this table and its justification holds.

Branches

Installs
75
GitHub Stars
634
First Seen
Jul 25, 2026