What I'm trying to achieve is to have a test function that allows me to check whenever a transition is feasible in an arbitrary state.
Imagine if you're trying to model light on/off switch.
your UI needs a method to check whenever the on or off action is available to eventually disable the related button.
Changes
I just exposed the StateTransition.call pre-checks into a separate method named canCall which would allow achieving the above.
I also thought about merging this code with the same checks in the call method but I didn't want to conflict with #57
Release Notes
Exported the StateTransition canCall method
Review
See CONTRIBUTING.md for more details on review types (+1 / QA +1 / +10) and code review process.
Please review:
QA Checklist
[x] Tests were updated and provide good coverage of the changeset and other affected code
Motivation
Similar #57 but for a different task.
What I'm trying to achieve is to have a test function that allows me to check whenever a transition is feasible in an arbitrary state.
Imagine if you're trying to model light on/off switch. your UI needs a method to check whenever the on or off action is available to eventually disable the related button.
Changes
I just exposed the StateTransition.call pre-checks into a separate method named
canCall
which would allow achieving the above.I also thought about merging this code with the same checks in the
call
method but I didn't want to conflict with #57Release Notes
Exported the StateTransition
canCall
methodReview
See CONTRIBUTING.md for more details on review types (+1 / QA +1 / +10) and code review process.
Please review:
QA Checklist
Merge Checklist
While we perform many automated checks before auto-merging, some manual checks are needed: