feat(cli,data-source,editor,playground,runtime): 支持自定义数据源
This commit is contained in:
@@ -100,15 +100,21 @@ class DataSourceManager extends EventEmitter {
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
this.change(ds);
|
||||
});
|
||||
|
||||
ds.on('change', () => {
|
||||
Object.assign(this.data[ds.id], ds.data);
|
||||
|
||||
this.emit('change', ds.id);
|
||||
this.change(ds);
|
||||
});
|
||||
}
|
||||
|
||||
public change(ds: DataSource) {
|
||||
Object.assign(this.data[ds.id], ds.data);
|
||||
|
||||
this.emit('change', ds.id);
|
||||
}
|
||||
|
||||
public removeDataSource(id: string) {
|
||||
this.get(id)?.destroy();
|
||||
delete this.data[id];
|
||||
|
||||
Reference in New Issue
Block a user