Open matb33 opened 5 years ago
I like that idea. We could perhaps set the initial machine as the $initial
property:
const machines = wirestate(...)
const App = machines['App']
const AppAsWell = machines.$initial // first machine if none is tagged as initial?
That's a great idea. Perfect!
We should discuss the return value of the generate
wirestate
function. For example, Alex's visualizer needs a predictable way to choose a machine to render. In app use it's easy, we can do e.g.machines['App']
. But for the visualizer, it's a bit trickier. We're going with a hardcoded 'Main' machine name as the default for now. Would be great to have a proper way of doing this.We had this idea that perhaps we could hint which one is the main one:
Leverage the "initial state" qualifier to signify it's the "initial machine".
Not sure what that does to the return value of wirestate though.