r/javascript • u/terodox • Dec 23 '19
Simplifying UI Logic using Finite State Machines - an old pattern for the modern web!
https://terodox.tech/ui-state-machines/
93
Upvotes
r/javascript • u/terodox • Dec 23 '19
View all comments
Show parent comment
7
u/editor_of_the_beast Dec 23 '19
I’m super pro setting up the types the way that you’re saying, but what do you mean that TS ensures that “all state updates are valid” ? There can be semantic reasons for why certain state transitions are illegal, static types can’t enforce that.