Skip to content

[email protected]

Pre-release
Pre-release
Compare
Choose a tag to compare
@github-actions github-actions released this 04 Nov 17:46
· 367 commits to main since this release
a79f2e4

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