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] Actor status object #4199

Closed
wants to merge 9 commits into from
Closed

[v5] Actor status object #4199

wants to merge 9 commits into from

Conversation

davidkpiano
Copy link
Member

No description provided.

@changeset-bot
Copy link

changeset-bot bot commented Aug 21, 2023

⚠️ No Changeset found

Latest commit: 27806d6

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

@codesandbox-ci
Copy link

codesandbox-ci bot commented Aug 21, 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 27806d6:

Sandbox Source
XState Example Template Configuration
XState React Template Configuration

@ghost
Copy link

ghost commented Aug 21, 2023

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

Review these changes using an interactive CodeSee Map

Legend

CodeSee Map legend

@davidkpiano
Copy link
Member Author

@Andarist Need help with the types 🥺

@@ -377,10 +377,10 @@ export class StateMachine<
state: State<TContext, TEvent, TActor, TOutput, TResolvedTypesMeta>
) {
return state.error
? { status: 'error', data: state.error }
? { status: 'error' as const, data: state.error }
Copy link
Member

Choose a reason for hiding this comment

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

As done in other PR, we could rename this here: data -> error

input: undefined,
data: (event as any).data, // TODO: if we keep this as `data` we should reflect this in the type
output: (event as any).data, // TODO: if we keep this as `data` we should reflect this in the type
Copy link
Member

Choose a reason for hiding this comment

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

after the change we'll be able to drop this comment

Copy link
Member

Choose a reason for hiding this comment

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

It would be cool to remove ActorStatus from here? piggy-back on the getStatus or smth like that?

# Conflicts:
#	packages/core/src/actors/index.ts
#	packages/core/src/interpreter.ts
@@ -64,14 +67,15 @@ export function fromObservable<T, TInput>(
});
return {
...state,
data: (event as any).data
output: (event as any).data
Copy link
Member

Choose a reason for hiding this comment

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

note: this is a mistake - nextEventType shouldn't assign to output. I'm working on this branch locally so I'll fix this.

@Andarist Andarist closed this Sep 22, 2023
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.

2 participants