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

Introduce TExpressionAction to make pure/choose types stricter and tweak action arg for inline actions #4197

Merged
merged 4 commits into from
Aug 21, 2023

Conversation

Andarist
Copy link
Member

No description provided.

@changeset-bot
Copy link

changeset-bot bot commented Aug 18, 2023

⚠️ No Changeset found

Latest commit: 7567523

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@Andarist Andarist marked this pull request as ready for review August 18, 2023 16:58
@codesandbox-ci
Copy link

codesandbox-ci bot commented Aug 18, 2023

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 7567523:

Sandbox Source
XState Example Template Configuration
XState React Template Configuration

@ghost
Copy link

ghost commented Aug 18, 2023

👇 Click on the image for a new way to code review

Review these changes using an interactive CodeSee Map

Legend

CodeSee Map legend

@Andarist Andarist changed the title Stricter types for pure/choose and tweak action arg for inline actions Introduce TExpressionAction to make pure/choose types stricter and tweak action arg for inline actions Aug 18, 2023
// entry: ({ action }) => {}
// exit: assign(({ action }) => {})
action: typeof action === 'string' ? { type: action } : (action as any)
// andarist
Copy link
Member

Choose a reason for hiding this comment

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

Andarist

Copy link
Member Author

Choose a reason for hiding this comment

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

oh no, u caught me marking my territory like a dog in a park - gonna remove this in a sec!

@Andarist Andarist merged commit 878db8a into v5/action-types Aug 21, 2023
2 checks passed
@Andarist Andarist deleted the action-arg-improvements branch August 21, 2023 13:36
Andarist added a commit that referenced this pull request Aug 22, 2023
…in a machine (#4180)

* Add TActions

* Break stuff

* YES

* Named action tests

* `TActions` -> `TAction`

* bring back simplified action~ type

* Introduce `TExpressionAction` to make `pure`/`choose` types stricter and tweak `action` arg for inline actions (#4197)

* Introduce `TExpressionAction`

* Tweak what action object gets provided to referenced and inline actions

* avoid casting

* Revert "avoid casting"

This reverts commit 9333e8d.

* Add changeset

* reorder some tests

* wrap tests in a block

* add more runtime-oriented tests

* add type-level tests

* add extra tests for pure

* fix choose and add extra test cases for it

---------

Co-authored-by: Mateusz Burzyński <mateuszburzynski@gmail.com>
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.

2 participants