MCPcopy
hub / github.com/antvis/Infographic / apply

Method apply

src/editor/commands/UpdateOptions.ts:10–21  ·  view source on GitHub ↗
(state: IStateManager)

Source from the content-addressed store, hash-verified

8 ) {}
9
10 async apply(state: IStateManager) {
11 if (!this.original) {
12 const prev = state.getOptions();
13 this.original = {};
14 (
15 Object.keys(this.options) as Array<keyof UpdatableInfographicOptions>
16 ).forEach((key) => {
17 (this.original as any)[key] = prev[key];
18 });
19 }
20 state.updateOptions(this.options);
21 }
22
23 async undo(state: IStateManager) {
24 if (this.original) {

Callers

nothing calls this directly

Calls 3

forEachMethod · 0.80
getOptionsMethod · 0.65
updateOptionsMethod · 0.65

Tested by

no test coverage detected