From c5ea813e005c490e7cf261d2dee9e9105109578e Mon Sep 17 00:00:00 2001 From: Alex Date: Mon, 20 May 2024 11:52:03 +0800 Subject: [PATCH] fix: test --- packages/devtools-kit/src/api/api.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/devtools-kit/src/api/api.ts b/packages/devtools-kit/src/api/api.ts index e2093310..e46f57de 100644 --- a/packages/devtools-kit/src/api/api.ts +++ b/packages/devtools-kit/src/api/api.ts @@ -23,8 +23,6 @@ import { updatePluginDetectives } from './plugin' export { collectDevToolsPlugin } from './plugin' -const stateEditor = new StateEditor() - export class DevToolsPluginApi { public on: typeof on public clear = remove @@ -150,11 +148,13 @@ export class DevToolsPluginApi { } async editInspectorState(payload: InspectorStateEditorPayload) { + const stateEditor = new StateEditor() apiHooks.callHook(DevToolsEvents.EDIT_INSPECTOR_STATE, { ...payload, app: devtoolsContext.appRecord?.app, set: (obj, path = payload.path, value = payload.state.value, cb) => { stateEditor.set(obj, path, value, cb || stateEditor.createDefaultSetCallback(payload.state)) + console.log('set', obj, path, value, cb || stateEditor.createDefaultSetCallback(payload.state)) }, }) }