Introduction to State Machines Using XState
Course on egghead by Kyle Shevlin
- 53 min
- LengthVideo runtime
- Free
- Price modelListed as free
- 22
- Lessons
- 4.8
- Rating out of 555 ratings on egghead
- Dec 2019
- Published18 Dec 2019
About this course
The difficulty of managing state is one of the primary reasons our applications become so complex. We try and manage this complexity with a lot of booleans, somewhat semantic variables like isLoading , wasFetched , and hasError , and over-engineered systems that are still full of bugs. Surely, there's a better way. That better way is state machines . State machines formalize how we define and transition through the states of our application and give us ultimate control of the most complex parts of our apps. In this course, we will explore the problems state machines purport to solve, like boolean explosion. We'll try to solve it our own way first, get so far, and then demonstrate how state machines get us all the way. After that, we'll dive into the XState library, JavaScript's premiere state machine library, to learn its API and how to use it to solve our problems.
What it covers
- 1Course Intro and Overview
- 2Eliminate Boolean Explosion by Enumerating States
- 3Replace Enumerated States with a State Machine
- 4Use an Interpreter to Instantiate a Machine
- 5Use XState Viz to Visually Develop and Test Your Machine
- 6Add Actions to Transitions to Fire Side Effects
- 7Trigger Actions When Entering and Exiting a XState State
- 8Replace Inline Functions with String Shorthands
- 9Use Internal Transitions in XState to Avoid State Exit and Re-Entry
- 10Send Events to the Machine with the XState Send Action Creator
- 11Track Infinite States with with XState Context
- 12How Action Order Affects Assigns to Context in a XState Machine
- 13Use Activities in XState to Run Ongoing Side Effects
- 14Conditionally Transition to States with Guards in XState
- 15Simplify State Explosion in XState through Hierarchical States
- 16Multiple Simultaneous States with Parallel States
- 17Recall Previous States with XState History States Nodes
- 18Use XState Null Events and Transient Transitions to Immediately Transition States
- 19Delay XState Events and Transitions
- 20Invoking a Promise for Asynchronous State Transitions in XState
- 21Invoke Callbacks to Send and Receive Events from a Parent XState Machine
- 22Invoke Child XState Machines from a Parent Machine
Similar state management courses
Same topic, nearest in length, up to three from any one provider.
Data read from the egghead catalogue on 28 Nov 2026. How the data is collected.