* setCheckpoint * This saves the `history` and `index` as a "checkpoint" that we can return to later. * If the given checkpointID exists, it will be overwritten. * @param {string} checkpointID - A string to identify the checkpoint
(checkpointID)
| 566 | * @param {string} checkpointID - A string to identify the checkpoint |
| 567 | */ |
| 568 | setCheckpoint(checkpointID) { |
| 569 | if (!checkpointID) return; |
| 570 | d3_select(document).interrupt('editTransition'); // complete any transition already in progress |
| 571 | |
| 572 | // Save a shallow copy of history, in case user undos away the edit that `_index` points to. |
| 573 | this._checkpoints.set(checkpointID, { |
| 574 | history: this._history.slice(), // shallow copy |
| 575 | index: this._index |
| 576 | }); |
| 577 | } |
| 578 | |
| 579 | |
| 580 | /** |
no outgoing calls
no test coverage detected