Whether there are actions to redo
Whether there are any actions to undo
Gets the current action
Gets the last action
Adds history action
The action
const prevSelection = editor.selection.items;
editor.history.add({
name: 'clear selection',
redo: () => { editor.selection.clear({ history: false }); },
undo: () => { editor.selection.set(prevSelection, { history: false }); },
});
Adds history action and execute redo
The action
const prevSelection = editor.selection.items;
editor.history.addAndExecute({
name: 'clear selection',
redo: () => { editor.selection.clear({ history: false }); },
undo: () => { editor.selection.set(prevSelection, { history: false }); },
});
The history API responsible for undo / redo.