Skip to content

feat: Add state history, undo/redo, and snapshot functionality#28

Open
vyquocvu wants to merge 1 commit into
mainfrom
feature-state-history
Open

feat: Add state history, undo/redo, and snapshot functionality#28
vyquocvu wants to merge 1 commit into
mainfrom
feature-state-history

Conversation

@vyquocvu
Copy link
Copy Markdown
Owner

This commit introduces a comprehensive state history management system to the anystate library.

The new features include:

  • State history tracking: All state changes are now recorded, enabling developers to traverse the state's history.
  • Undo/redo functionality: The undo and redo methods allow for easy navigation through the state history.
  • Snapshot management: The createSnapshot and restoreSnapshot methods provide a way to save and load the state at any point in time.
  • Action replay: The replayAction method allows for the reapplication of actions to the state.

These features have been implemented in a modular and efficient way, with a new History class that manages the state snapshots. The existing AnyState class has been updated to integrate with the new history system.

Comprehensive tests have been added to ensure the correctness and stability of the new features.

This commit introduces a comprehensive state history management system to the `anystate` library.

The new features include:
- State history tracking: All state changes are now recorded, enabling developers to traverse the state's history.
- Undo/redo functionality: The `undo` and `redo` methods allow for easy navigation through the state history.
- Snapshot management: The `createSnapshot` and `restoreSnapshot` methods provide a way to save and load the state at any point in time.
- Action replay: The `replayAction` method allows for the reapplication of actions to the state.

These features have been implemented in a modular and efficient way, with a new `History` class that manages the state snapshots. The existing `AnyState` class has been updated to integrate with the new history system.

Comprehensive tests have been added to ensure the correctness and stability of the new features.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant