]> git.ipfire.org Git - thirdparty/vuejs/pinia.git/commitdiff
docs: typos and references
authorEduardo San Martin Morote <posva13@gmail.com>
Mon, 11 Jul 2022 09:29:47 +0000 (11:29 +0200)
committerEduardo San Martin Morote <posva13@gmail.com>
Mon, 11 Jul 2022 09:29:47 +0000 (11:29 +0200)
Close #1441

packages/docs/core-concepts/state.md

index db47b014fe84507242e273144626c58d6bc08bc7..a54b9b91bd64d19034181cf0907ee4b6f74bd6eb 100644 (file)
@@ -64,8 +64,8 @@ import { defineStore } from 'pinia'
 
 const useCounterStore = defineStore('counterStore', {
   state: () => ({
-    counter: 0
-  })
+    counter: 0,
+  }),
 })
 ```
 
@@ -129,7 +129,8 @@ Apart from directly mutating the store with `store.counter++`, you can also call
 ```js
 store.$patch({
   counter: store.counter + 1,
-  name: 'Abalam',
+  age: 120,
+  name: 'DIO',
 })
 ```
 
@@ -144,14 +145,14 @@ cartStore.$patch((state) => {
 
 <!-- TODO: disable this with `strictMode`, `{ noDirectPatch: true }` -->
 
-The main difference here is that `$patch()` allows you to group multiple changes into one single entry in the devtools. Note **both, direct changes to `state` and `$patch()` appear in the devtools** and can be time travelled (not yet in Vue 3).
+The main difference here is that `$patch()` allows you to group multiple changes into one single entry in the devtools. Note **both, direct changes to `state` and `$patch()` appear in the devtools** and can be time traveled (not yet in Vue 3).
 
 ## Replacing the `state`
 
 You can replace the whole state of a store by setting its `$state` property to a new object:
 
 ```js
-store.$state = { counter: 666, name: 'Paimon' }
+store.$state = { counter: 24 }
 ```
 
 You can also replace the whole state of your application by changing the `state` of the `pinia` instance. This is used during [SSR for hydration](../ssr/#state-hydration).