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

docs(core-concepts): add info about using detached: true in store subscriptions inside plugins #1781

Closed
wants to merge 1 commit into from

Conversation

F0rsaken
Copy link

@F0rsaken F0rsaken commented Nov 7, 2022

Added note in docs about using detached: true with $subscribe and $onAction inside plugins in Core conepts -> plugins to help people avoid problems mentioned in this issue #991 about losing subscriptions after a component is destroyed.

@netlify
Copy link

netlify bot commented Nov 7, 2022

Deploy Preview for pinia-official ready!

Name Link
🔨 Latest commit 286a1e7
🔍 Latest deploy log https://app.netlify.com/sites/pinia-official/deploys/636906ae76f8260009fbf4c6
😎 Deploy Preview https://deploy-preview-1781--pinia-official.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@posva
Copy link
Member

posva commented Nov 8, 2022

Thanks for this. After some inspection I realized there is no problem, I even wrote a test for it in the subscriptions spec... I'm sorry I asked you to create a PR for this. The plugins in pinia are ran within the store's effect scope, which means they are disconnected from a regular $subscribe() in a component's setup...

I refactored the code at 57405de but it seems like it works without the change. If you found a case that doesn't work, a bug report with a reproduction would help.

@posva posva closed this Nov 8, 2022
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.

None yet

2 participants