Do This Instead Of Representing State With Booleans

Опубликовано: 09 Май 2026
на канале: Joy of Code
118,660
4.1k

Learn how to go from using booleans to represent state to writing a reducer and a simple state machine in Svelte to using XState to avoid impossible states and have more confidence your code works as expected.

👉️ Support

▶️ YouTube Membership
https://youtube.com/@joyofcodedev/join

🔴 Patreon
  / joyofcode  

👉️ Links:

XState
🔗 https://xstate.js.org/

Stately
🔗 https://stately.ai/

Introduction To State Machines Using XState
🔗 https://egghead.io/courses/introducti...

How To Tell A Bad Boolean From A Good Boolean
🔗 https://dev.to/mattpocockuk/state-man...

How To Stop Making Horcruxes In Your Code
🔗 https://dev.to/mattpocockuk/state-mac...

You Don't Need A Library For State Machines
🔗 https://dev.to/davidkpiano/you-don-t-...

👉️ Uses:

🔗 https://joyofcode.xyz/uses

👉️ Socials:

🐦️   / joyofcodedev  
💬   / discord  

🔖 Timestamps

0:00 Intro
0:29 Booleans
2:32 Enums
3:38 State Machines
5:14 Reducer Pattern
6:22 Faux State Machine
8:47 Using XState
11:52 Outro

#svelte #xstate #joyofcode