Skip to content

xstate@6.0.0-beta.11

Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 06 Dec 08:29
· 6 commits to next since this release
8d42e24

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.