Check out a free preview of the full State Machines in JavaScript with XState, v2 course

The "State Transitions Exercise" Lesson is part of the full, State Machines in JavaScript with XState, v2 course featured in this preview video. Here's what you'd learn in this lesson:

Students are instructed to recreate the playerMachine to practice adding the initial states, states in the state object, and transitions in each of those states.

Preview
Close

Transcript from the "State Transitions Exercise" Lesson

[00:00:00]
>> Getting back to the first exercise. What I want you to do is if you see anything in the player machine, delete it and start over. I want you to recreate that machine and just get a feel for adding initial states, so initial states and adding all the states in the state object and also adding the transitions in each of those states.

[00:00:28]
And so you'll also notice that this is connected to the application. So if we go to 01 states transitions, these buttons, at least a couple of them the play and pause buttons should work. So, ideally, that's what should happen. We already have the code that hooks that up.

[00:00:53]
So, yeah.

Learn Straight from the Experts Who Shape the Modern Web

  • In-depth Courses
  • Industry Leading Experts
  • Learning Paths
  • Live Interactive Workshops
Get Unlimited Access Now