Skip to content

Type Editor


Type Editor / @type-editor/history / helper/redo-depth

helper/redo-depth

Functions

FunctionDescription

redoDepth

Returns the number of redoable events available in the editor's history.

This can be used to determine whether the redo command is available, or to display the redo history depth in the UI.

Example

typescript
const canRedo = redoDepth(state) > 0;
console.log(`You can redo ${redoDepth(state)} changes`);