statelyai / xstate

Actor-based state management & orchestration for complex app logic.
https://stately.ai/docs
MIT License
27.23k stars 1.26k forks source link

feat(core): add actor ID to DoneActorEvent, ErrorActorEvent #4942

Closed boneskull closed 5 months ago

boneskull commented 5 months ago

This changes DoneActorEvent (xstate.done.actor.*) and ErrorActorEvent (xstate.error.actor.*) to have an actorId prop which is equal to the ID of the Actor associated with the event.

Previously, this information was only available by extracting it from the type property of the event object using string operations.


Updated a test for DoneActorEvent to prove that actorId gets passed, but may want the same test for an ErrorActorEvent.

Ref: https://discord.com/channels/795785288994652170/1250894522616123494

changeset-bot[bot] commented 5 months ago

🦋 Changeset detected

Latest commit: 8edf73bd0beef067b11c7c7bf97dd571eea903c0

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

This PR includes changesets to release 1 package | Name | Type | | ------ | ----- | | xstate | Minor |

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

boneskull commented 5 months ago

New prop is now actorId

boneskull commented 5 months ago

@davidkpiano Suggestions committed

boneskull commented 5 months ago

@davidkpiano Is that something I should be doing?

davidkpiano commented 5 months ago

@davidkpiano Is that something I should be doing?

Yes please

boneskull commented 5 months ago

@davidkpiano Done. Hope I did that right. It looks like a minor bump to me