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

[core] Add enqueue.sendParent(…) #4981

Merged
merged 2 commits into from
Jul 19, 2024
Merged

Conversation

davidkpiano
Copy link
Member

Added sendParent to the enqueueActions feature. This allows users to enqueue actions that send events to the parent actor within the enqueueActions block.

import { createMachine, enqueueActions } from 'xstate';

const childMachine = createMachine({
  entry: enqueueActions(({ enqueue }) => {
    enqueue.sendParent({ type: 'CHILD_READY' });
  })
});

Copy link

changeset-bot bot commented Jul 15, 2024

🦋 Changeset detected

Latest commit: f46c226

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

@davidkpiano davidkpiano merged commit c4ae156 into main Jul 19, 2024
1 check passed
@davidkpiano davidkpiano deleted the davidkpiano/enqueue-sendparent branch July 19, 2024 16:05
@github-actions github-actions bot mentioned this pull request Jul 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant