Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(state-history): 🔥 Add an option to control future state #475

Merged
merged 1 commit into from
Aug 6, 2023
Merged

feat(state-history): 🔥 Add an option to control future state #475

merged 1 commit into from
Aug 6, 2023

Conversation

johnfewell
Copy link
Contributor

@johnfewell johnfewell commented Aug 6, 2023

An option called resetFutureOnNewState has been added to the StateHistoryOptions interface. This option allows the user to control whether the future redo states should be cleared when a new state is added after the user has undone one or more state changes. The default value of this option is set to false, meaning that by default, the future states will not be cleared.

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

[ ] Bugfix
[x] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Documentation content changes
[ ] Other... Please describe:

What is the current behavior?

Currently, when a new state is added after the user has undone one or more state changes, the future redo states are not cleared.

Issue Number: N/A

What is the new behavior?

A new option called resetFutureOnNewState has been added to the StateHistoryOptions interface. This option allows the user to control whether the future redo states should be cleared when a new state is added after the user has undone one or more state changes. The default value of this option is set to false, meaning that by default, the future states will not be cleared.

Does this PR introduce a breaking change?

[ ] Yes
[x] No

Other information

This new feature provides more control to the user over the state history and can prevent unnecessary state changes from being redone. It is a useful feature for applications that need finer control over state changes and their history.

An option called resetFutureOnNewState has been added to the
StateHistoryOptions interface. This option allows the user to control
whether the future redo states should be cleared when a new state is
added after the user has undone one or more state changes. The default
value of this option is set to false, meaning that by default, the
future states will not be cleared.
@stackblitz
Copy link

stackblitz bot commented Aug 6, 2023

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@NetanelBasal NetanelBasal merged commit 65738ad into ngneat:master Aug 6, 2023
1 check passed
@johnfewell johnfewell deleted the feat/future-state-reset branch August 6, 2023 16:17
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.

None yet

2 participants