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

Added methods to remove states and transitions from state machines. #464

Merged
merged 1 commit into from
May 17, 2022

Conversation

benk-gc
Copy link
Contributor

@benk-gc benk-gc commented May 16, 2022

Historically, when a state machine uses a template and wants to remove a
state or transition it will just set a guard that always returns false.
This isn't a particularly neat solution since the states and transitions
still exist on the state machine, and can make inspecting the internals
of the state machine return misleading information.

This change adds explicit methods to allow a state machine to delete
states or transitions. When a state is deleted, all related transitions
and callbacks will also be cleaned up as appropriate.

@benk-gc benk-gc force-pushed the benk/delete-methods-for-statemachine branch from d3518d1 to f6968be Compare May 16, 2022 10:58
Historically, when a state machine uses a template and wants to remove a
state or transition it will just set a guard that always returns false.
This isn't a particularly neat solution since the states and transitions
still exist on the state machine, and can make inspecting the internals
of the state machine return misleading information.

This change adds explicit methods to allow a state machine to delete
states or transitions. When a state is deleted, all related transitions
and callbacks will also be cleaned up as appropriate.
@benk-gc benk-gc force-pushed the benk/delete-methods-for-statemachine branch from f6968be to 42379b1 Compare May 16, 2022 11:00
@benk-gc benk-gc merged commit 3796f85 into master May 17, 2022
@benk-gc benk-gc deleted the benk/delete-methods-for-statemachine branch May 17, 2022 08:58
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.

2 participants