Want more egghead?

This lesson is for members. Join us? Get access to all 3,000+ tutorials + a community with expert developers around the world.

Become a Member
1×
Become a member
to unlock all features
Autoplay

    Invoke an XState Service when Entering a State

    reactReact
    >=16.9.0
    xstateXState
    >=4.6.7

    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.