]> git.ipfire.org Git - thirdparty/vuejs/pinia.git/commitdiff
docs: small usage notes
authorEduardo San Martin Morote <posva13@gmail.com>
Fri, 17 Jan 2020 14:17:48 +0000 (15:17 +0100)
committerEduardo San Martin Morote <posva13@gmail.com>
Mon, 20 Jan 2020 18:21:46 +0000 (19:21 +0100)
README.md

index 906ce7d73a33cb85fd6581ebc326cdca37e66800..3aa8eebab55296d69274677a347fce4dc5e9e990 100644 (file)
--- a/README.md
+++ b/README.md
@@ -10,7 +10,7 @@
 
 ⚠️⚠️⚠️ This project is experimental, it's an exploration of what a _Store_ could be like using [the composition api](https://vue-composition-api-rfc.netlify.com). It works for Vue 2 by using the [official library](https://github.com/vuejs/composition-api).
 
-What I want is to inspire others to think about ways to improve Vuex and come up with something that works very well with the composition api but that can also be used **without it**.
+What I want is to inspire others to think about ways to improve Vuex and come up with something that works very well with the composition api. Ideally it could also be used without it. **@vue/composition-api is necessary**.
 
 There are the core principles that I try to achieve with this experiment:
 
@@ -67,11 +67,13 @@ A few notes about the project and possible questions:
 ## Installation
 
 ```sh
-yarn add pinia
+yarn add pinia @vue/composition-api
 # or with npm
-npm install pinia
+npm install pinia @vue/composition-api
 ```
 
+Note: **The Vue Composition API plugin must be installed for Pinia to work**
+
 ## Usage
 
 ### Creating a Store
@@ -204,7 +206,7 @@ When writing a Single Page Application, there always only one instance of the st
 - `setup`
 - `serverPrefetch`
 
-Meaning that you can call `useMainStore` at the top of these functions and it will retrieve the correct store.
+Meaning that you can call `useMainStore` at the top of these functions and it will retrieve the correct store. Calling it anywhere else requires you to pass the current `req` to `useMainStore`.
 
 #### Nuxt Plugin
 
@@ -229,7 +231,7 @@ export default {
 }
 ```
 
-**This is necessary in middlewares and other asyncronous methods**
+Note: **This is necessary in middlewares and other asyncronous methods**
 
 It may look like things are working even if you don't pass `req` to `useStore` **but multiple concurrent requests to the server could end up sharing state between different users**.