Skip to content

Commit 068f2a7

Browse files
authored
[@xstate/store] Snapshot undo/redo strategy (#5415)
* Add undoRedoSnapshot functionality with transaction grouping and history limit * Add compare function to undoRedoSnapshot for skipping duplicate snapshots and enhance testing for snapshot history management * Add strategies + changeset update * Knip * send -> trigger
1 parent 8ec428e commit 068f2a7

File tree

3 files changed

+890
-93
lines changed

3 files changed

+890
-93
lines changed

.changeset/slow-states-repeat.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
'@xstate/store': minor
3+
---
4+
5+
Add snapshot-based undo/redo strategy to `undoRedo(…)`:
6+
7+
```ts
8+
// Snapshot strategy (faster undo/redo, more memory)
9+
undoRedo(config, {
10+
strategy: 'snapshot',
11+
historyLimit: 10
12+
});
13+
```

0 commit comments

Comments
 (0)