From: Eduardo San Martin Morote Date: Mon, 7 Jun 2021 21:17:42 +0000 (+0200) Subject: fix: markRaw on pinia X-Git-Tag: v0.5.3~10 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=208e6c00d2d6077b818a7f99f000b177a1f96107;p=thirdparty%2Fvuejs%2Fpinia.git fix: markRaw on pinia --- 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