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

fixedCacheKey makes cache not clear when unmounted #4839

Open
pgsandstrom opened this issue Jan 30, 2025 · 2 comments
Open

fixedCacheKey makes cache not clear when unmounted #4839

pgsandstrom opened this issue Jan 30, 2025 · 2 comments

Comments

@pgsandstrom
Copy link

So I am using fixedCacheKey since two components need to share the same cache for a mutation. But when I unmount all components and re-mount them, the cache is still present. Am I expected to manually reset the cache if I usefixedCacheKey? This feels cumbersome. Is there no way of sharing mutation-cache without having to manually clear the cache?

@phryneas
Copy link
Member

Imagine it the other way round - if we did that, we would already have five issues that important data had suddenly disappeared.
If you choose to share mutation data between components, we don't even know if those components will be active at the same time - you opt into handling that data manually by using fixedCacheKey.

@pgsandstrom
Copy link
Author

I see. In that case, maybe the documentation should just be made more clear.

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

No branches or pull requests

2 participants