1
0
mirror of synced 2026-03-25 20:58:38 +08:00

feat(cli,data-source,editor,playground,runtime): 支持自定义数据源

This commit is contained in:
roymondchen
2023-08-21 16:57:18 +08:00
parent 60e14fe53e
commit 573f1a2c17
28 changed files with 528 additions and 269 deletions

View File

@@ -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];