The history API responsible for undo / redo.

Hierarchy

  • Events
    • History

Internal

Other

  • Adds history action

    Parameters

    Returns void

    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

    Parameters

    Returns void

    const prevSelection = editor.selection.items;
    editor.history.addAndExecute({
    name: 'clear selection',
    redo: () => { editor.selection.clear({ history: false }); },
    undo: () => { editor.selection.set(prevSelection, { history: false }); },
    });