Skip to content

Commit

Permalink
feat(data-source): 数据源新增setValue方法
Browse files Browse the repository at this point in the history
  • Loading branch information
roymondchen committed Jul 16, 2024
1 parent 059c005 commit 8d111ea
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/data-source/src/data-sources/Base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,10 @@ export default class DataSource<T extends DataSourceSchema = DataSourceSchema> e
this.emit('change', changeEvent);
}

public setValue(path: string, data: any) {
return this.setData(data, path);
}

public onDataChange(path: string, callback: (newVal: any) => void) {
this.#observedData.on(path, callback);
}
Expand Down

0 comments on commit 8d111ea

Please sign in to comment.