From 2022308e21abe7c1960743f1ac25ad607b3be965 Mon Sep 17 00:00:00 2001 From: liujuping Date: Thu, 23 Jun 2022 11:52:53 +0800 Subject: [PATCH] refactor: remove redundant monitor files --- packages/editor-core/src/utils/index.ts | 1 - packages/editor-core/src/utils/monitor.ts | 42 ----------------------- 2 files changed, 43 deletions(-) delete mode 100644 packages/editor-core/src/utils/monitor.ts diff --git a/packages/editor-core/src/utils/index.ts b/packages/editor-core/src/utils/index.ts index 0e269ef3b..c01cdfc17 100644 --- a/packages/editor-core/src/utils/index.ts +++ b/packages/editor-core/src/utils/index.ts @@ -1,5 +1,4 @@ export * from './get-public-path'; -export * from './monitor'; export * from './obx'; export * from './request'; export * from './focus-tracker'; diff --git a/packages/editor-core/src/utils/monitor.ts b/packages/editor-core/src/utils/monitor.ts deleted file mode 100644 index 0889d4565..000000000 --- a/packages/editor-core/src/utils/monitor.ts +++ /dev/null @@ -1,42 +0,0 @@ -export class Monitor { - fn = (params: any) => { - const { AES = {} } = window as any; - if (typeof AES.log === 'function') { - const { p1 = '', p2 = '', p3 = '', p4 = 'OTHER', ...rest } = params || {}; - AES.log('event', { - p1, - p2, - p3, - p4, - ...rest, - }); - } - }; - - register(fn: () => any) { - if (typeof fn === 'function') { - this.fn = fn; - } - } - - log(params: any) { - if (typeof this.fn === 'function') { - this.fn(params); - } - } - - setConfig(key: string | object, value?: string): void { - const { AES = {} } = window as any; - if (typeof AES?.setConfig !== 'function') { - return; - } - if (typeof key === 'string' && value) { - AES.setConfig(key, value); - } else if (typeof key === 'object') { - AES.setConfig(key); - } - } -} - -const monitor = new Monitor(); -export { monitor };