-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[v5] Actor status object #4199
Conversation
|
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:
|
@Andarist Need help with the types 🥺 |
packages/core/src/StateMachine.ts
Outdated
@@ -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 } |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
packages/core/src/interpreter.ts
Outdated
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
No description provided.