MCPcopy Create free account
hub / github.com/facebook/Rapid / _reset

Method _reset

modules/core/EditSystem.js:187–213  ·  view source on GitHub ↗

* _reset * Internal reset of all stored data

()

Source from the content-addressed store, hash-verified

185 * Internal reset of all stored data
186 */
187 _reset() {
188 d3_select(document).interrupt('editTransition'); // complete any transition already in progress
189 this.deferredBackup.cancel();
190
191
192 // Create a new Base Graph / Base Edit.
193 const baseGraph = new Graph();
194 const base = new Edit({ graph: baseGraph });
195 this._history = [ base ];
196 this._index = 0;
197
198 // Create a work-in-progress Edit derived from the base edit.
199 const currGraph = new Graph(baseGraph);
200 const staging = new Edit({ graph: currGraph });
201 this._staging = staging;
202 this._hasWorkInProgress = false;
203 this._tree = new Tree(currGraph);
204
205 this._lastStableGraph = baseGraph;
206 this._lastStagingGraph = currGraph;
207 this._fullDifference = new Difference(baseGraph, baseGraph);
208
209 this._backupStatus = true;
210 this._checkpoints.clear();
211 this._inTransition = false;
212 this._inTransaction = false;
213 }
214
215
216 /**

Callers 2

initAsyncMethod · 0.95
resetAsyncMethod · 0.95

Calls 1

clearMethod · 0.45

Tested by

no test coverage detected