TimeTraveller
Auto-generated from the @jbrowse/mobx-state-tree model in the source. See the developer guide for concepts. Built into JBrowse core. View source.
Undo/redo history for a target state-tree node: records snapshots as it changes and exposes canUndo/canRedo with undo/redo actions.
Properties
| Member | Description |
|---|---|
undoIdxnumber · default -1 |
|
targetPathstring · default '' |
Volatiles
| Member | Description |
|---|---|
historyunknown[] |
|
steps(HistoryStep | undefined)[] |
|
notTrackingUndoboolean |
|
hasPendingRecordboolean |
Getters
| Member | Description |
|---|---|
canUndoboolean |
|
canRedoboolean |
Actions
| Member | Description |
|---|---|
setHasPendingRecord(value: boolean) => void |
|
flushPendingRecord() => void |
|
stopTrackingUndo() => void |
|
resumeTrackingUndo() => void |
|
addUndoState(snapshot: unknown, step?: HistoryStep) => void |
|
record(step: HistoryStep) => void |
Make step's change now, as one history entry of its own, whose undo and redo replay the step before applying the target's snapshot. |
initialize() => void |
Start recording history for the target store. Runs again whenever the root replaces the session node, so it must be idempotent: it disposes the previous registration and resets the history, because history is volatile while undoIdx is a persisted prop, and old session snapshots kept would let undo apply them to the new session. |
undo() => void |
|
redo() => void |