Open
Conversation
added 11 commits
November 9, 2017 12:12
Author
|
Hmm - trying this in a real world app and seeing a bug in the visualization generation. Hold off until I figure it out. -- Ah - never mind. I had added states with the same name as the transition name. I suppose in principle, that's ok. I wonder if it would be worth enforcing not allowing that? It's something I would like to detect in my own usage... At any rate, I caught it in the visualization (another reason I think the visualization capability is a killer feature.) Followup: |
Added tests.
|
@rickbsgu contribution welcomed. https://github.com/taoqf/javascript-state-machine |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes add the option to define states prior to transitions.
Allows:
Also adds a dot prefix definition to set attributes for the entire graph (the default is pretty ugly.) A default set is specified, but can be overridden.
Statedefs are implemented in parallel with the current state mechanism to insure that the package still works as before. The statedefs mechanism only kicks in if statedefs are defined in the fsm definition.
All of the regression tests pass (had to modify the plugin/visualize test somewhat extensively to accommodate the dot prefix mechanism.) I also have added a test file with some tests (statedefs.js). Thinking of more.
Finally, some small changes to the 'examples' executable to allow a single example to be run. Added an example 'traffic_light_statedefs' that demonstrates the dot attributes for states.
I haven't touched the documentation - want to field thoughts from you on where would be the appropriate place to document this.
Let me know what your thoughts are.
Thanks,
rickb