Check out a free preview of the full State Machines in JavaScript with XState course:
The "Actor Model Exercise" Lesson is part of the full, State Machines in JavaScript with XState course featured in this preview video. Here's what you'd learn in this lesson:

Students are instructed to use the invoke property to invoke a promise that eventually resolves or rejects with a value, and to then transition to the appropriate states.

Get Unlimited Access Now

Transcript from the "Actor Model Exercise" Lesson

[00:00:00]
>> So in exercise 12, we're saying that instead of a fire and forget action, which cannot communicate back directly to a machine, we wants to instead invoke an actor. Because remember, actors can send messages back to their parents. And so to do that, we're going to be using the invoke property in x date, and so that's going to invoke a promise that eventually resolves with a value or it could reject with a value.

[00:00:27] And based on what happens with events we get, we could transition to the appropriate states.