Construct Sturdy UIs with xstate

Why State Machines?

  • Old Idea
  • Planning
  • Visual

Component State

  • Local
  • Changeable
    • From Inside the Component
    • To Anything

Redux State

  • Global
  • Changeable
    • By Specific Events
    • To Anything

State Machines

  • Local
  • Changeable
    • By Specific Events
    • To A Defined State

You are already using state machines.

How to spot a state machine:

  • Multiple related booleans
  • An enum that defines a sequence
  • UI that progresses through steps

What state machines have you seen?

Is this a state machine?

  • What are the states?
     
  • What are the events?
     
  • What are the transitions and actions?
     
  • Does it need to track any values in context?

Slide Machine

Construct Sturdy UIs with xstate

By Isaac Mann

Construct Sturdy UIs with xstate

  • 291