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

[@xstate/fsm] Add support for targetless transitions #1911

Merged
merged 5 commits into from Feb 5, 2021

Conversation

davidkpiano
Copy link
Member

This PR adds support for transitions with undefined targets, which will not exit/re-enter the state.

// ...
someState: {
  entry: [/* ... */],
  exit: [/* ... */],
  on: {
    SOME_EVENT: {
      // undefined target - will not exit/re-enter
      actions: [/* ... */]
    }
  }
}
// ...

@changeset-bot
Copy link

changeset-bot bot commented Feb 5, 2021

🦋 Changeset detected

Latest commit: 349b657

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

This PR includes changesets to release 1 package
Name Type
@xstate/fsm 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.

As I don't believe we are dealing with internal transitions here I would also adjust the PR title to avoid that term

.changeset/afraid-eggs-wonder.md Outdated Show resolved Hide resolved
packages/xstate-fsm/src/index.ts Outdated Show resolved Hide resolved
packages/xstate-fsm/src/index.ts Show resolved Hide resolved
davidkpiano and others added 3 commits February 5, 2021 10:49
Co-authored-by: Mateusz Burzyński <mateuszburzynski@gmail.com>
Co-authored-by: Mateusz Burzyński <mateuszburzynski@gmail.com>
@davidkpiano davidkpiano changed the title [@xstate/fsm] Add support for "internal" transitions [@xstate/fsm] Add support for targetless transitions Feb 5, 2021
@davidkpiano davidkpiano merged commit 2cc3190 into master Feb 5, 2021
@davidkpiano davidkpiano deleted the davidkpiano/fsm-internal branch February 5, 2021 23:12
@github-actions github-actions bot mentioned this pull request Feb 5, 2021
@cblanc
Copy link

cblanc commented Feb 8, 2021

Thanks! 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants