The Core Elements of an XState Machine

preview_player
Показать описание
In this video I walk through the core elements of an XState machine. To do this, I build a super minimal machine that can be viewed all at once but has enough detail to be interesting. I also discuss different modeling considerations as I do a quick refactoring of the machine.
Рекомендации по теме
Комментарии
Автор

great video, not sure why your <input></input> bugs me so much lol. Looking forward to see more xState as i agree its a paradigm shift, and i really wanna get good at it. Also think you can do event.type === 'increment', instead of state.value, but if u use the createModel, it has a cool way to do same thing in the assign: const assignAge = userModel.assign(
{
// The `event.type` here is restricted to "updateAge"
age: (_, event) => event.value // inferred as `number`
},
'updateAge' // Restricts the `event` allowed by the "assignAge" action
);

chris
Автор

It's a small evolution of Redux, right ?

guildem