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

[v5] Final .data to .output #3952

Merged
merged 9 commits into from
Apr 8, 2023
Merged

[v5] Final .data to .output #3952

merged 9 commits into from
Apr 8, 2023

Conversation

davidkpiano
Copy link
Member

This PR renames .data to .output on final states:

const machine = createMachine({
  // ...
  states: {
    // ...
    success: {
-     data: { message: 'Success!' }
+     output: { message: 'Success!' }
    }
  }
})

@changeset-bot
Copy link

changeset-bot bot commented Apr 8, 2023

🦋 Changeset detected

Latest commit: 95d36cc

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

This PR includes changesets to release 1 package
Name Type
xstate Major

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

@codesandbox-ci
Copy link

codesandbox-ci bot commented Apr 8, 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 95d36cc:

Sandbox Source
XState Example Template Configuration
XState React Template Configuration

@ghost
Copy link

ghost commented Apr 8, 2023

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

Review these changes using an interactive CodeSee Map

Legend

CodeSee Map legend

// ...
success: {
- data: { message: 'Success!' }
+ output: { message: 'Success!' }
Copy link
Member

Choose a reason for hiding this comment

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

this later becomes part of the done.state.* and done.invoe.* events, should we rename the properties in those events as well?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not sure. I think there should be a difference between "this is the output of this machine" and "this is the data in this event". Not sure yet.

@Andarist Andarist merged commit ec30083 into next Apr 8, 2023
2 checks passed
@Andarist Andarist deleted the v5/output branch April 8, 2023 22:15
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

2 participants