File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ Example:
1212
1313``` typescript
1414import { withUndoRedo } from ' @angular-architects/ngrx-toolkit' ;
15+ import { clearUndoRedo } from ' @angular-architects/ngrx-toolkit' ;
1516
1617const SyncStore = signalStore (
1718 withUndoRedo ({
@@ -32,7 +33,6 @@ public class UndoRedoComponent {
3233
3334 canUndo = this .store .canUndo ; // use in template or in ts
3435 canRedo = this .store .canRedo ; // use in template or in ts
35- clearStack = this .store .clearStack ; // use in template or in ts
3636
3737 undo(): void {
3838 if (! this .canUndo ()) return ;
@@ -45,7 +45,11 @@ public class UndoRedoComponent {
4545 }
4646
4747 clearStack(): void {
48+ // Does a soft reset (not setting the state to `null`) by default.
4849 clearUndoRedo (this .store );
50+
51+ // The hard reset can be set via options,
52+ // clearUndoRedo(store, { lastRecord: null })
4953 }
5054}
5155```
You can’t perform that action at this time.
0 commit comments