Use Pinia stores in each other #1673
Unanswered
snake-py
asked this question in
Help and Questions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Reproduction
To reproduce you need to boot a new vue 2.7 project and install pinia and then have two stores using each other
Steps to reproduce the bug
The storeToRef function is not working like expected if you use two stores in each other. If store A is using refs from store B and store B uses refs from store A then unpacked refs will be undefined.
sessionStore.ts
appStore.ts
In my main vue component I am doing this:
useBootLoader
Expected behavior
That I can use storeToRefs exchangeably and not only one way. I thought pinia is not hierarchal.
Actual behavior
storeToRefs doesn't unpack the refs from another store correctly. It is working if only one store uses another store but not if both stores use each other.
Additional information
No response
Beta Was this translation helpful? Give feedback.
All reactions