]> git.ipfire.org Git - thirdparty/vuejs/pinia.git/commitdiff
docs: remove old functions
authorEduardo San Martin Morote <posva13@gmail.com>
Wed, 3 Mar 2021 15:14:03 +0000 (16:14 +0100)
committerEduardo San Martin Morote <posva@users.noreply.github.com>
Thu, 4 Mar 2021 15:43:47 +0000 (16:43 +0100)
README.md

index 4fdb0697a63dbeb1b1eba05efa2062ef34e392c0..3f6be5d057ba46650fd0c260f028efca18565222 100644 (file)
--- a/README.md
+++ b/README.md
@@ -317,16 +317,12 @@ In a Raw Vue SSR application you have to modify a few files to enable hydration
 
 ```js
 // entry-server.js
-import { getRootState, PiniaSsr } from 'pinia'
-
-// install plugin to automatically use correct context in setup and onServerPrefetch
-Vue.use(PiniaSsr)
-
 export default (context) => {
+  const pinia = createPinia()
   /* ... */
   context.rendered = () => {
     // pass state to context
-    context.piniaState = getRootState(context.req)
+    context.piniaState = pinia.state.value
   }
   /* ... */
 }
@@ -345,8 +341,11 @@ export default (context) => {
 // entry-client.js
 import { setStateProvider } from 'pinia'
 
+const pinia = createPinia()
+// install and inject pinia...
+// ...
 // inject ssr-state
-setStateProvider(() => window.__PINIA_STATE__)
+pinia.state.value = window.__PINIA_STATE__
 ```
 
 ### Accessing other Stores