Effective State Machines with XState | David Khourshid | Effect Miami 2
Effect | TypeScript for the AI Era ยท Published 2026-07-26 ยท 29:40 ยท S tier ยท XState and state machines
Thumbnails load from YouTube's image host. A video plays from youtube-nocookie.com only after you press its play button. Each video also has a direct link to youtube.com.
Summary
David Khourshid uses state machines to make application behavior explicit. Examples show a video player moving through named states, with transitions describing what events are allowed to do.
He introduces actors as stateful units that receive messages, then explores running those transitions with Effect. The closing distinction is between safe execution and correct logic: Effect can handle failures and requirements while a machine describes the intended behavior.
Section notes
- 5:07: A state machine follows explicit transitions between named states.
- 10:22: The video example reveals hard-coded action implementations.
- 15:40: Actors own internal state and respond to messages.
- 21:08: An Effect-backed loop reads a mailbox and applies transitions and actions.
- 26:27: The talk distinguishes execution safety from correct application logic.
Key concepts
Our take
David Khourshid shows how async/await hides errors and flow, models a video player as a state machine in XState, and ends on Effect and XState as complementary tools. It is the pairing this stack uses for lifecycles.
Related videos
- Effective state machines for complex logic by David Khourshid (Effect Days 2024)
- Webinar: State Machines and Actors with XState v5
- David Khourshid: Simplifying Complex UIs with Finite Automata & Statecharts | JSConf Iceland 2018
- Production-Grade TypeScript by Johannes Schickling (Effect Days 2024)
Summary based on the transcript. Written 2026-11-15.