فهرست منبع

refactor: remove event emitter leak warning threshold (#1013)

* refactor: remove event emitter leak warning threshold

* fix: remove duplicate 'git clone' in documentation
Louis Young 1 ماه پیش
والد
کامیت
c30b2cf329

+ 1 - 1
apps/docs/src/en/guide/runtime/quick-start.mdx

@@ -23,7 +23,7 @@ Since FlowGram Runtime is positioned as a demo rather than an SDK and will not b
 If you just want to try it out without submitting changes, you can clone the original repository directly:
 
 ```bash
-git clone git clone git@github.com:bytedance/flowgram.ai.git
+git clone git@github.com:bytedance/flowgram.ai.git
 cd flowgram.ai
 ```
 

+ 1 - 1
apps/docs/src/zh/guide/runtime/quick-start.mdx

@@ -23,7 +23,7 @@ sidebar_position: 3
 如果您只是想尝试使用而不需要提交更改,可以直接克隆原始仓库:
 
 ```bash
-git clone git clone git@github.com:bytedance/flowgram.ai.git
+git clone git@github.com:bytedance/flowgram.ai.git
 cd flowgram.ai
 ```
 

+ 0 - 5
packages/common/utils/src/event.ts

@@ -19,8 +19,6 @@ export namespace Event {
 }
 
 export class Emitter<T = any> {
-  static LEAK_WARNING_THRESHHOLD = 175;
-
   private _event?: Event<T>;
 
   private _listeners?: EventListener<T>[];
@@ -37,9 +35,6 @@ export class Emitter<T = any> {
           this._listeners = [];
         }
         const finalListener = thisArgs ? listener.bind(thisArgs) : listener;
-        if (this._listeners.length >= Emitter.LEAK_WARNING_THRESHHOLD) {
-          console.warn(`[Emitter] Listeners length >= ${Emitter.LEAK_WARNING_THRESHHOLD}`);
-        }
         this._listeners.push(finalListener);
 
         const eventDisposable: Disposable = {