statelyai / xstate

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

[core] Wildcard emitted event listener #4905

Closed davidkpiano closed 1 month ago

davidkpiano commented 1 month ago

You can now use a wildcard to listen for any emitted event from an actor:

actor.on('*', (emitted) => {
  console.log(emitted); // Any emitted event
});
changeset-bot[bot] commented 1 month ago

🦋 Changeset detected

Latest commit: 7af2043429f172333eb1f78617231f1db47c40f6

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

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

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

davidkpiano commented 1 month ago

@Andarist ping 🏓