The type of the state being managed, must be serializable to JSON.
The unique id of the view. This is passed to the view component as the id prop.
The slice name for the session data.
OptionalinitialState: IUndoState<T>The initial undo state. Will be used if there is no existing session data.
[undoObject, loaded] - An undo object for managing state history and loaded flag.
Custom hook to manage undo/redo state using session data storage.