MCPcopy Create free account
hub / github.com/alibaba/lowcode-engine / getState

Method getState

packages/designer/src/document/history.ts:170–186  ·  view source on GitHub ↗

* | 1 | 1 | 1 | * | -------- | -------- | -------- | * | modified | redoable | undoable |

()

Source from the content-addressed store, hash-verified

168 * | modified | redoable | undoable |
169 */
170 getState(): number {
171 const { cursor } = this.session;
172 let state = 7;
173 // undoable ?
174 if (cursor <= 0) {
175 state -= 1;
176 }
177 // redoable ?
178 if (cursor >= this.records.length - 1) {
179 state -= 2;
180 }
181 // modified ?
182 if (this.point === cursor) {
183 state -= 4;
184 }
185 return state;
186 }
187
188 /**
189 * 监听 state 变更事件

Callers 3

constructorMethod · 0.95
goMethod · 0.95
savePointMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected