From 5fcca788c1da61f2a406e2924fca3a8bed51b667 Mon Sep 17 00:00:00 2001
From: Eduardo San Martin Morote
Date: Thu, 3 Jun 2021 16:02:01 +0200
Subject: [PATCH] fix(devtools): register stores
---
docs/.vitepress/components/TestStore.vue | 8 ++++++++
src/devtools/plugin.ts | 4 +++-
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/docs/.vitepress/components/TestStore.vue b/docs/.vitepress/components/TestStore.vue
index 2a624eea..156f07f4 100644
--- a/docs/.vitepress/components/TestStore.vue
+++ b/docs/.vitepress/components/TestStore.vue
@@ -3,12 +3,20 @@
I have a store "{{ userStore.name }}". I have
{{ cartStore.items.length }} items in the cart.
+
+
Counter: {{ counterStore.double }} = 2 x {{ counterStore.n }}
+
+
+
+
diff --git a/src/devtools/plugin.ts b/src/devtools/plugin.ts
index 9e90aae7..af98d1a6 100644
--- a/src/devtools/plugin.ts
+++ b/src/devtools/plugin.ts
@@ -42,11 +42,13 @@ function addDevtools(app: App, store: Store) {
// TODO: we probably need to ensure the latest version of the store is kept:
// without effectScope, multiple stores will be created and will have a
// limited lifespan for getters.
+ // add a dev only variable that is removed in unmounted and replace the store
let hasSubscribed = true
if (!registeredStores.has(store.$id)) {
registeredStores.set(store.$id, store)
componentStateTypes.push('ð ' + store.$id)
- hasSubscribed = true
+ hasSubscribed = false
+ console.log('registing for the first time')
}
setupDevtoolsPlugin(
--
2.47.3