Skip to content

Active store after component unmounts #2495

Closed Answered by posva
LadIQe asked this question in Help and Questions
Discussion options

You must be logged in to vote

If I remember correctly (it was almost year ago) all stores within component were "destroyed" when component unmounts and "installed" when you come back. You could see in devtools "x" store installed" multiple times.

This seems unlikely, to stay alive is the whole point of the store. If you need them to go away with the component, they should probably not be a store but just a composable. This will of course not let you reuse the the same data across components since each composable call would recreate state but it sounds like you are passing props so it should be good.

If you still need the global access, you can always manually dispose of the store in the root component

const store = u…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@LadIQe
Comment options

Answer selected by LadIQe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants