github statelyai/xstate xstate@5.0.0-beta.33

latest releases: @xstate/vue@4.0.0, @xstate/store@2.6.1, @xstate/svelte@4.0.0...
pre-release13 months ago

Minor Changes

  • #4082 13480c3a9 Thanks @davidkpiano! - You can now inspect actor system updates using the inspect option in createActor(logic, { inspect }). The types of inspection events you can observe include:

    • @xstate.actor - An actor ref has been created in the system
    • @xstate.event - An event was sent from a source actor ref to a target actor ref in the system
    • @xstate.snapshot - An actor ref emitted a snapshot due to a received event
    import { createMachine } from 'xstate';
    
    const machine = createMachine({
      // ...
    });
    
    const actor = createActor(machine, {
      inspect: (inspectionEvent) => {
        if (inspectionEvent.type === '@xstate.actor') {
          console.log(inspectionEvent.actorRef);
        }
    
        if (inspectionEvent.type === '@xstate.event') {
          console.log(inspectionEvent.sourceRef);
          console.log(inspectionEvent.targetRef);
          console.log(inspectionEvent.event);
        }
    
        if (inspectionEvent.type === '@xstate.snapshot') {
          console.log(inspectionEvent.actorRef);
          console.log(inspectionEvent.event);
          console.log(inspectionEvent.snapshot);
        }
      }
    });

Patch Changes

  • #4336 17da18692 Thanks @Andarist! - Invoked actors will no longer be automatically started (added to .children) when those children are missing in the persisted state.

Don't miss a new xstate release

NewReleases is sending notifications on new releases.