(op: JSONOp, source = 'user' /* user, api */)
| 122 | } |
| 123 | |
| 124 | dispatch(op: JSONOp, source = 'user' /* user, api */) { |
| 125 | const prevDoc = this.getState(); |
| 126 | this.apply(op); |
| 127 | // TODO: remove doc in future |
| 128 | const doc = this.getState(); |
| 129 | debug.log(JSON.stringify(op)); |
| 130 | this.muya.eventCenter.emit('json-change', { |
| 131 | op, |
| 132 | source, |
| 133 | prevDoc, |
| 134 | doc, |
| 135 | }); |
| 136 | } |
| 137 | |
| 138 | getState(): TState[] { |
| 139 | return deepClone(this._state); |
no test coverage detected