Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for single-state (combinatorial) machines #2079

Merged
merged 2 commits into from
Apr 11, 2021

Conversation

davidkpiano
Copy link
Member

This PR adds support for combinatorial machines:

  • No initial property
  • No state property
  • Root-level transitions
const testMachine = createMachine({
  context: { value: 42 },
  on: {
    INC: {
      actions: assign({ value: (ctx) => ctx.value + 1 })
    }
  }
});

The finite state.value of the combinatorial machine is an empty object: {}

@changeset-bot
Copy link

changeset-bot bot commented Apr 11, 2021

🦋 Changeset detected

Latest commit: e37fffe

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
xstate Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Member

@Andarist Andarist left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This almost feels like a bug fix to me 😅

@davidkpiano davidkpiano merged commit 636348c into master Apr 11, 2021
@github-actions github-actions bot mentioned this pull request Apr 11, 2021
@Andarist Andarist deleted the davidkpiano/combinatorial branch April 11, 2021 22:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants