Course lesson

Invoke an XState Service when Entering a State

It can be tedious to create a paired success and failure event for each external action that a state machine triggers. Instead xstate can integrate directly with a promise and respond to the resolve or reject status of the promise itself.

Duration
3 min
Access
Pro
Transcript
Available

It can be tedious to create a paired success and failure event for each external action that a state machine triggers. Instead xstate can integrate directly with a promise and respond to the resolve or reject status of the promise itself.