From: Eduardo San Martin Morote Date: Mon, 8 Mar 2021 13:21:41 +0000 (+0100) Subject: chore: fix failing tests X-Git-Tag: v2.0.0-alpha.8~45 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=cf458a9e3702005f7e696a27b63e4ec84d0cde24;p=thirdparty%2Fvuejs%2Fpinia.git chore: fix failing tests --- 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) {