fix:修改config.onGot 和 editor.onGot 方法与文档不一致的问题

This commit is contained in:
za-liyong002 2023-02-27 23:48:09 +08:00 committed by 林熠
parent 33a4192e2c
commit 65a040390f
2 changed files with 9 additions and 13 deletions

View File

@ -288,13 +288,11 @@ export class EngineConfig implements IEngineConfig {
const val = this.config?.[key];
if (val !== undefined) {
fn(val);
return () => {};
} else {
this.setWait(key, fn);
return () => {
this.delWait(key, fn);
};
}
this.setWait(key, fn);
return () => {
this.delWait(key, fn);
};
}
notifyGot(key: string): void {

View File

@ -190,13 +190,11 @@ export class Editor extends (EventEmitter as any) implements IPublicModelEditor
const x = this.context.get(keyOrType);
if (x !== undefined) {
fn(x);
return () => { };
} else {
this.setWait(keyOrType, fn);
return () => {
this.delWait(keyOrType, fn);
};
}
this.setWait(keyOrType, fn);
return () => {
this.delWait(keyOrType, fn);
};
}
register(data: any, key?: IPublicTypeEditorValueKey): void {