mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-09-19 21:06:06 +08:00
feat(data-source): 新增判断所有数据源加载完成的方法
This commit is contained in:
parent
a35789c0cf
commit
dc37d4e8bd
@ -203,7 +203,7 @@ class DataSourceManager extends EventEmitter {
|
|||||||
this.setData(ds, changeEvent);
|
this.setData(ds, changeEvent);
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!this.app.dsl?.dataSources || this.dataSourceMap.size === this.app.dsl.dataSources.length) {
|
if (this.isAllDataSourceRegistered()) {
|
||||||
this.emit('registered-all');
|
this.emit('registered-all');
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -328,6 +328,10 @@ class DataSourceManager extends EventEmitter {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public isAllDataSourceRegistered() {
|
||||||
|
return !this.app.dsl?.dataSources?.length || this.dataSourceMap.size === this.app.dsl.dataSources.length;
|
||||||
|
}
|
||||||
|
|
||||||
public destroy() {
|
public destroy() {
|
||||||
this.removeAllListeners();
|
this.removeAllListeners();
|
||||||
this.data = {};
|
this.data = {};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user