From: Eduardo San Martin Morote Date: Wed, 3 Mar 2021 15:14:03 +0000 (+0100) Subject: docs: remove old functions X-Git-Tag: v0.2.0~33 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f6ebe8c854389229be30b9ffbca5f1384ab2aaa7;p=thirdparty%2Fvuejs%2Fpinia.git docs: remove old functions --- diff --git a/README.md b/README.md index 4fdb0697..3f6be5d0 100644 --- 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