github statelyai/xstate xstate@6.0.0-beta.11

latest releases: @xstate/effect@1.0.0-beta.5, @xstate/webmcp@0.1.0-beta.2
pre-releaseone hour ago

Patch Changes

  • ee72c1b: assertEvent(event, 'greet') now narrows generic event parameters, including members whose type is a union of literals. When a pattern might match multiple template-literal event types, check the payload before reading a property specific to one member.

  • 6cfa774: In xstate/fsm, a literal always transition with no target or with its own state as the target now throws a configuration error. Remove the transition or use an always function that returns undefined when it should stop.

    createFSM({
      context: { ready: false },
      initial: 'idle',
      states: {
        idle: {
          always: ({ context }) =>
            context.ready ? undefined : { context: { ready: true } }
        }
      }
    });
  • fdcd5a6: getPersistedSnapshot() now keeps a child actor whose invoke id is __proto__, instead of dropping it from the persisted children. Restoring such a snapshot brings the child back as with any other id.

Don't miss a new xstate release

NewReleases is sending notifications on new releases.