github statelyai/xstate xstate@5.0.0-beta.40

latest releases: xstate@5.14.0, @xstate/store@1.0.0, xstate@5.13.2...
pre-release8 months ago

Minor Changes

  • #4414 26fbc6c85 Thanks @davidkpiano! - All inspector events (snapshot, event, actor) now have a common actorRef property. This makes it easier to discern which inspection event is for which actor:

    const actor = createActor(someMachine, {
      inspect: (event) => {
        // Was previously a type error
        if (event.actorRef === actor) {
          // This event is for the root actor
        }
    
        if (event.type === '@xstate.event') {
          // previously event.targetRef
          event.actorRef;
        }
      }
    });

    In the 'xstate.event' event, the actorRef property is now the target actor (recipient of the event). Previously, this was the event.targetRef property (which is now removed).

Patch Changes

Don't miss a new xstate release

NewReleases is sending notifications on new releases.