2 ms·
> State machines are great but they get quite complicated when you have two machines interacting at some point. I suppose this depends a bit on how transitions
by e12e 7y ago
> State machines are great but they get quite complicated when you have two machines interacting at some point.
I suppose this depends a bit on how transitions are triggered.
If an ux even can trigger a change in state machine a, from state a1 to a2, and that transition can fire off an event that trigger a transition in b, from b1 to b2, and that transition fires an event that triggers a transition from a1.... Then you have problems.
It would probably be better to model a and b as a bigger machine c, that models all states and transitions, and allow the various components/widgets to be "views" of this machine c?
Or; make sure that a state transition won't in and of itself fire an event that triggers a transition in another state machine. Ie: a and could both respond to window resize, but should not trigger a window resize.