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

fix(reactivity): ensure watch(Effect) can run independent of unmounted instance if created in a detatched effectScope (fix #7319) #7330

Merged
merged 2 commits into from Jan 9, 2023

Conversation

LinusBorg
Copy link
Member

close #7319

…d instance if created in a detatched effectScope
@LinusBorg
Copy link
Member Author

/cc @posva this should solve your problem in pinia.

Copy link
Member

@posva posva left a comment

Choose a reason for hiding this comment

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

Nice! I think it would be even better to have 2 different count variables as it would make the test more robust

@LinusBorg
Copy link
Member Author

Good call, will do.

@posva posva self-requested a review December 13, 2022 09:12
@LinusBorg LinusBorg merged commit cd7c887 into main Jan 9, 2023
13 checks passed
@LinusBorg LinusBorg deleted the linusborg/issue-7319 branch January 9, 2023 14:20
chrislone pushed a commit to chrislone/core that referenced this pull request Feb 4, 2023
…d instance if created in a detatched effectScope (fix vuejs#7319) (vuejs#7330)

* fix(reactivity): ensure watch(Effect) can run independent of unmounted instance if created in a detatched effectScope

* test: use separate counters for each watcher to make test more robust
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.

watchEffect within effectScope is removed when component is unmounted
3 participants