From cf458a9e3702005f7e696a27b63e4ec84d0cde24 Mon Sep 17 00:00:00 2001 From: Eduardo San Martin Morote Date: Mon, 8 Mar 2021 14:21:41 +0100 Subject: [PATCH] chore: fix failing tests --- src/devtools.ts | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/devtools.ts b/src/devtools.ts index d6e97242..b2538e1b 100644 --- a/src/devtools.ts +++ b/src/devtools.ts @@ -17,11 +17,7 @@ function formatDisplay(display: string) { /** * Registered stores used for devtools. */ -export const stores = /*#__PURE__*/ new Set() - -export function registerStore(store: GenericStore) { - stores.add(store) -} +const registeredStores = /*#__PURE__*/ new Set() function toastMessage( message: string, @@ -43,7 +39,7 @@ function toastMessage( let isAlreadyInstalled: boolean | undefined export function addDevtools(app: App, store: GenericStore) { - registerStore(store) + registeredStores.add(store) setupDevtoolsPlugin( { id: 'pinia', @@ -120,7 +116,7 @@ export function addDevtools(app: App, store: GenericStore) { api.on.getInspectorTree((payload) => { if (payload.app === app && payload.inspectorId === piniaInspectorId) { - const stores = Array.from(stores) + const stores = Array.from(registeredStores) payload.rootNodes = (payload.filter ? stores.filter((store) => @@ -133,7 +129,7 @@ export function addDevtools(app: App, store: GenericStore) { api.on.getInspectorState((payload) => { if (payload.app === app && payload.inspectorId === piniaInspectorId) { - const stores = Array.from(stores) + const stores = Array.from(registeredStores) const store = stores.find((store) => store.$id === payload.nodeId) if (store) { -- 2.47.3