Pinia Cheat Sheet
Pinia Cheat Sheet
<script setup>
import { useProductStore } from './stores/ProductStore'
<script>
import { useProductStore } from './stores/ProductStore'
import { mapStores } from 'pinia'
store.$state = { x: 1, y: 2, z: 3 }
change the entire state
store.$reset()
change the entire state back to the initial values
Subscribe to changes