From 5ae615cdbea0d30143522b7350860ee4e79dc807 Mon Sep 17 00:00:00 2001 From: Michael Small Date: Sun, 18 Jan 2026 22:57:08 -0600 Subject: [PATCH] docs: mention `clearUndoRedo` soft/hard --- docs/docs/with-undo-redo.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/docs/with-undo-redo.md b/docs/docs/with-undo-redo.md index 527fbfe8..ad9413ed 100644 --- a/docs/docs/with-undo-redo.md +++ b/docs/docs/with-undo-redo.md @@ -12,6 +12,7 @@ Example: ```typescript import { withUndoRedo } from '@angular-architects/ngrx-toolkit'; +import { clearUndoRedo } from '@angular-architects/ngrx-toolkit'; const SyncStore = signalStore( withUndoRedo({ @@ -32,7 +33,6 @@ public class UndoRedoComponent { canUndo = this.store.canUndo; // use in template or in ts canRedo = this.store.canRedo; // use in template or in ts - clearStack = this.store.clearStack; // use in template or in ts undo(): void { if (!this.canUndo()) return; @@ -45,7 +45,11 @@ public class UndoRedoComponent { } clearStack(): void { + // Does a soft reset (not setting the state to `null`) by default. clearUndoRedo(this.store); + + // The hard reset can be set via options, + // clearUndoRedo(store, { lastRecord: null }) } } ```