Make meta as a third parameter in actions, guards, services #1486
Unanswered
cybervaldez
asked this question in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Can we have meta as a standard third parameter for actions, guards, services? Metas are a great way to describe a node especially since compared to context they are read only, it also works like a bridge for machine logic and UI. For ex:
We can now share the same logic with the UI.
<input type={current.meta.age.input_type} onChange={(e)=>send({ type: 'ASSIGN', key : 'age', value : e.target.value }) } />
On top of this, exposing meta on the visualizer would make the machine more readable.
Caveats/Issues:
With how meta is currently laid out requires the knowledge of the state node ids which isn't what we want for actions, services, guards but aggregating meta like in the docs would solve this.
The third parameter in guards is reserved for custom guards.
Beta Was this translation helpful? Give feedback.
All reactions