]> git.ipfire.org Git - thirdparty/vuejs/pinia.git/commitdiff
fix: markRaw on pinia
authorEduardo San Martin Morote <posva13@gmail.com>
Mon, 7 Jun 2021 21:17:42 +0000 (23:17 +0200)
committerEduardo San Martin Morote <posva13@gmail.com>
Mon, 7 Jun 2021 21:18:24 +0000 (23:18 +0200)
src/rootStore.ts
src/store.ts

index ae2d91cdc5f9dea1cf3399709b695b8be0af912c..ead62f39317a3543df9aaa437a786424b3b5b6cd 100644 (file)
@@ -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
index 2f54e29a1e0bf3f36fa64fdaeffd4f2e1356b467..e4f9927f705a72efd242469246afcd7eaacb5ce6 100644 (file)
@@ -209,7 +209,7 @@ function initStore<
 
   const storeWithState: StoreWithState<Id, S, G, A> = {
     $id,
-    _p: markRaw(pinia),
+    _p: pinia,
     _as: markRaw(actionSubscriptions as unknown as StoreOnActionListener[]),
 
     // $state is added underneath