web-state-pinia
Installation
SKILL.md
Pinia Patterns
Quick Guide: Pinia holds shared client state in Vue 3, as flat independent stores with no modules and no mutations. Two syntaxes: Options stores read like the Options API and come with
$reset(), Setup stores read like<script setup>and can call other composables. Two rules cause most of the bugs — destructure throughstoreToRefs()or reactivity is lost silently, and return every ref from a Setup store or SSR, DevTools and plugins each see a store with holes in it.
Detailed Resources:
- examples/core.md — Options stores, Setup stores,
storeToRefs, composing stores - examples/persistence.md — selective persistence across sessions
- examples/plugins.md — a logging plugin, and a
$resetfor Setup stores - examples/testing.md — unit-testing stores, and mounting components with a testing store
- examples/ssr.md — SSR-safe stores, hydration, client-only guards
- reference.md — the syntax comparison table, anti-pattern code, TypeScript recipes, performance notes