MCPcopy Create free account
hub / github.com/DTStack/molecule / update

Method update

src/services/problemsService.ts:97–120  ·  view source on GitHub ↗
(item: IProblemsItem<T> | IProblemsItem<T>[])

Source from the content-addressed store, hash-verified

95 );
96 }
97 public update<T>(item: IProblemsItem<T> | IProblemsItem<T>[]) {
98 const problems = Array.isArray(item) ? item : [item];
99 const { data } = this.state;
100
101 problems.forEach((problem) => {
102 const index = data.findIndex(searchById(problem.id));
103 if (index > -1) {
104 data.splice(index, 1, problem);
105 } else {
106 logger.error(
107 `Update problems failed, because there is no problem found via ${problem.id}`
108 );
109 }
110 });
111
112 this.setState(
113 {
114 data: [...data],
115 },
116 () => {
117 this.updateStatusBar();
118 }
119 );
120 }
121 public remove(id: UniqueId | UniqueId[]): void {
122 const ids = Array.isArray(id) ? id : [id];
123

Callers

nothing calls this directly

Calls 3

updateStatusBarMethod · 0.95
searchByIdFunction · 0.90
setStateMethod · 0.80

Tested by

no test coverage detected