Get the most easiest undo redo feature for your npm project
npm install easyUndoRedo --save
import {easyUndoRedo} from 'easy-undo-redo';
var UndoRedo = new easyUndoRedo({
stackLength : 20,
initialValue : "Your initial data"
});
UndoRedo.save("Your updated data");
UndoRedo.undo(); //returns undo result
UndoRedo.redo(); //returns redo result