From 208e6c00d2d6077b818a7f99f000b177a1f96107 Mon Sep 17 00:00:00 2001 From: Eduardo San Martin Morote Date: Mon, 7 Jun 2021 23:17:42 +0200 Subject: [PATCH] fix: markRaw on pinia --- src/rootStore.ts | 6 +++--- src/store.ts | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/rootStore.ts b/src/rootStore.ts index ae2d91cd..ead62f39 100644 --- a/src/rootStore.ts +++ b/src/rootStore.ts @@ -1,4 +1,4 @@ -import { InjectionKey, ref, Ref } from '@vue/composition-api' +import { InjectionKey, markRaw, ref, Ref } from '@vue/composition-api' import { StateTree, StoreWithState, @@ -137,7 +137,7 @@ export function createPinia(): Pinia { const _p: Pinia['_p'] = [] - const pinia: Pinia = { + const pinia: Pinia = markRaw({ use(plugin) { _p.push(plugin) return pinia @@ -146,7 +146,7 @@ export function createPinia(): Pinia { _p, state, - } + }) // this allows calling useStore() outside of a component setup after // installing pinia's plugin diff --git a/src/store.ts b/src/store.ts index 2f54e29a..e4f9927f 100644 --- a/src/store.ts +++ b/src/store.ts @@ -209,7 +209,7 @@ function initStore< const storeWithState: StoreWithState = { $id, - _p: markRaw(pinia), + _p: pinia, _as: markRaw(actionSubscriptions as unknown as StoreOnActionListener[]), // $state is added underneath -- 2.47.3