Why is disposePinia not available? #2477
-
I'm building a micro-front-end application that lives within a Nuxt SPA. My application needs to be able to be mounted and unmounted many times during the lifetime of the host application and I want all state to be reset in-between so I create a new Pinia instance every time. I have a few Pinia setup stores that use shared composables created with Pinia stores don't seem to be disposed when my application is unmounted and from what I've read on GitHub issues and discussions this seems to be intended, which I can understand. But this prevents the shared composables from also being disposed when my application is unmounted since the store effect scopes are never stopped. When I mount a new instance of my application, a new Pinia instance is created along with new stores but my shared composables which weren't allowed to be disposed are still alive and reused but still hold references to the old stores which are not connected to my new Vue application instance so things misbehave until I reload the page. I tried to find a way to dispose of Pinia manually when my application is unmounted and I found the function I copied the function into my codebase and it seems to work fine, allowing the shared composables to be disposed when my application is unmounted. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
it's just not released yet because it needs some more testing and feedback |
Beta Was this translation helpful? Give feedback.
it's just not released yet because it needs some more testing and feedback