Re:The World of Statecharts
by spiffytech on Monday December 23, 2019 @07:21PM
(#21868775)
How have you managed keeping your machine's state and context consistent? Although I can control transitions easily, I've found it's easy to miss updating parts of my machine's internal context when wiring up transitions. I wind up with my component thinking it's in a particular State, with a context that doesn't match up.
[ Parent
| on HN ]
Isn’t that the job of actions after an transition happened? (modifying the internal context according to the event).
Re:The World of Statecharts
by spiffytech on Monday December 23, 2019 @07:28PM
(#21868831)
It is indeed. However, I've found the problem of writing assignment actions correctly is very similar to the problem of managing ordinary variables without xstate. I'm wondering if I'm doing this right, since I thought xstate was supposed to make that kind of bug much rarer.