Syntax changes and renames to State and Flow Handlers #81
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.
All of these except the last are ones we discussed yesterday. I implemented them in Hero to see if it made my scripts feel simpler and they did, so I submitted a PR.
allTrue
in State has been simplified down to justall
with the first argument beingassert
and not{ assert }
:all(assert)
callback:checkFlowHandlers
has been renamed totriggerFlowHandlers
to be more precise in what it does.checkState
has been renamed tovalidateState
. I understand why we went with "checkState" as "ensureState" wasn't quite accurate (it doesn't actually ensure anything, it just returns a boolean). However, check never felt right in my script flow; I want it for a purpose, to validate the current state. Anyway, I'm cool reverting back to "checkState" if you want.One thought... We've discussed wanting to pass state assertion results into Flow Handler callbacks. Similarly, returning a "validation object" from
validateState
of what assertions passed would be really nice and further lean towards thevalidateState
name.