Opeartion Stack

1 min read

pushStack(action, data, stackType)

Push operation。

Implemented the undo function, refer to here

Implemented the redo function, refer tohere

参数

NameTypeRequiredDescription
actionstringfalseoperation type,the value of 'update' by default
dataunknownfalseStacked data
stackType'redo' / 'undo'falsepush operation type,the value of 'undo' by default

getUndoStack()

get undo stack。

getRedoStack()

get redo stack。

getStackData()

get the data in stack。

The return value type:

{
  undoStack: StackData[];
  redoStack: StackData[];
};

clearStack()

Clear the data in stack。