]> git.ipfire.org Git - thirdparty/vuejs/pinia.git/commitdiff
Explicit title for store props destructuring (#2282)
authorLou Rectoret <despertaweb@protonmail.com>
Wed, 28 Jun 2023 07:26:11 +0000 (09:26 +0200)
committerGitHub <noreply@github.com>
Wed, 28 Jun 2023 07:26:11 +0000 (09:26 +0200)
* Explicit title for  store props destructuring

I' m pretty sure lots of people are googling how to destructure the store. Let's make it easy with a nice and beautiful title

* Update packages/docs/core-concepts/index.md

---------

Co-authored-by: Eduardo San Martin Morote <posva@users.noreply.github.com>
packages/docs/core-concepts/index.md

index cb2826bcd86ce5f29ccf9336aac7e1d191fc942b..2eab5b4da575a57cdab4ff9665c94ed587cf2c1c 100644 (file)
@@ -139,6 +139,8 @@ const doubleValue = computed(() => store.doubleCount)
 </script>
 ```
 
+## Destructuring from a Store
+
 In order to extract properties from the store while keeping its reactivity, you need to use `storeToRefs()`. It will create refs for every reactive property. This is useful when you are only using state from the store but not calling any action. Note you can destructure actions directly from the store as they are bound to the store itself too:
 
 ```vue