MCPcopy Create free account
hub / github.com/Monogatari/Monogatari / didApply

Method didApply

src/actions/ShowImage.ts:112–123  ·  view source on GitHub ↗
({ updateHistory = true, updateState = true } = {})

Source from the content-addressed store, hash-verified

110 }
111
112 override async didApply({ updateHistory = true, updateState = true } = {}): Promise<ActionApplyResult> {
113 if (updateHistory === true) {
114 (this.engine.history('image') as string[]).push(this._statement as string);
115 }
116
117 if (updateState === true) {
118 this.engine.state({
119 images: [...this.engine.state('images'), this._statement as string]
120 });
121 }
122 return { advance: true };
123 }
124
125 override async revert(): Promise<void> {
126 this.engine.element().find(`[data-image="${this.asset}"]`).remove();

Callers 1

onLoadMethod · 0.45

Calls 2

historyMethod · 0.80
stateMethod · 0.80

Tested by

no test coverage detected