Skip to content

Commit

Permalink
docs: fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
posva committed Mar 28, 2024
1 parent af30d88 commit e887bfd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/docs/core-concepts/plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ import { toRef, ref } from 'vue'
pinia.use(({ store }) => {
// to correctly handle SSR, we need to make sure we are not overriding an
// existing value
if (!Object.prototype.hasOwnProperty(store.$state, 'hasError')) {
if (!store.$state.hasOwnProperty('hasError')) {
// hasError is defined within the plugin, so each store has their individual
// state property
const hasError = ref(false)
Expand All @@ -144,7 +144,7 @@ If you are using **Vue 2**, Pinia is subject to the [same reactivity caveats](ht
```js
import { set, toRef } from '@vue/composition-api'
pinia.use(({ store }) => {
if (!Object.prototype.hasOwnProperty(store.$state, 'secret')) {
if (!store.$state.hasOwnProperty('secret')) {
const secretRef = ref('secret')
// If the data is meant to be used during SSR, you should
// set it on the `$state` property so it is serialized and
Expand All @@ -169,7 +169,7 @@ import { toRef, ref } from 'vue'

pinia.use(({ store }) => {
// this is the same code as above for reference
if (!Object.prototype.hasOwnProperty(store.$state, 'hasError')) {
if (!store.$state.hasOwnProperty('hasError')) {
const hasError = ref(false)
store.$state.hasError = hasError
}
Expand Down

0 comments on commit e887bfd

Please sign in to comment.