You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 8, 2025. It is now read-only.
Optionally add a `groupId` to identify related command pairs. Undo and redo actions will then be performed on all adjacent command pairs with that group id.
114
+
115
+
```js
116
+
undoManager.add({
117
+
groupId:'auth',
118
+
undo: () =>removePerson(id),
119
+
redo: () =>addPerson(id, name)
120
+
});
121
+
```
122
+
123
+
96
124
### undo
97
125
98
126
Performs the undo action.
@@ -101,6 +129,8 @@ Performs the undo action.
101
129
undoManager.undo();
102
130
```
103
131
132
+
If a `groupId` was set, the undo action will be performed on all adjacent command pairs with that group id.
133
+
104
134
### redo
105
135
106
136
Performs the redo action.
@@ -109,6 +139,8 @@ Performs the redo action.
109
139
undoManager.redo();
110
140
```
111
141
142
+
If a `groupId` was set, the redo action will be performed on all adjacent command pairs with that group id.
143
+
112
144
### clear
113
145
114
146
Clears all stored states.
@@ -159,10 +191,11 @@ const index = undoManager.getIndex();
159
191
160
192
### getCommands
161
193
162
-
Returns the list of queued commands.
194
+
Returns the list of queued commands, optionally filtered by group id.
0 commit comments