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

Ensure children are removed when stopped. Fixes #1457 #1559

Closed
wants to merge 1 commit into from

Conversation

davidkpiano
Copy link
Member

Depends on #795

@changeset-bot
Copy link

changeset-bot bot commented Oct 15, 2020

⚠️ No Changeset found

Latest commit: b4b032c

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Base automatically changed from davidkpiano/795 to master October 19, 2020 03:02
expect(service.children.get('machineChild')).toBeUndefined();
expect(service.children.get('promiseChild')).toBeUndefined();
expect(service.children.get('observableChild')).toBeUndefined();
done();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if this really should be allowed. It's basically bypassing the machinery of state machine, allowing for arbitrary, imperative, manipulation of its internal state. This also doesn't quite deliver proper cleanup:

typeof service.state.context.machineRef === 'object'
typeof service.state.context.promiseRef === 'object'
typeof service.state.context. observableRef === 'object'

This is the common case - spawned actors are usually assigned to the context. Clearing context values would definitely be too magical (and not trivial - with the current APIs it would require a full crawl of the current context).

@davidkpiano
Copy link
Member Author

Will rework this to use the stop(...) action creator instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants