-
-
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
[core] Transition function #4954
Conversation
🦋 Changeset detectedLatest commit: 9ee7564 The changes in this PR will be included in the next version bump. This PR includes changesets to release 6 packages
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 |
Just a reminder to remove commented lines before merging 💜 |
packages/core/src/stateUtils.ts
Outdated
action.exec?.( | ||
{ | ||
...action.info, | ||
self: actor, | ||
system: actor.system | ||
}, | ||
action.params | ||
); |
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.
@davidkpiano this is missing action lookup in machine.implementations.actions
. You can't rely on .exec
being available if the goal is to have serializable actions. In fact, I'd probably just forbid combining inline actions with machine.executeAction
. It should be an invariant that to use this API all actions must be declared explicitly in machine.implementations.actions
. It's impossible to resolve an enqueued inline action, they are not discoverable in the static config at all. So it would be best to forbid all inline actions to make the rules clear around this.
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.
We fixed this, right?
ba900db
to
ca2977f
Compare
This PR adds the
transition(…)
function for returning a[snapshot, actions]
tuple given the machine, state, and event.Its main use-case is for server-side workflows and a pure way of handling state transitions for actor logic.