Vue · Middle · Question 44 of 75
How can one Pinia store use another?
- ✓Correct answer: Call the other store's hook inside the store's setup function or inside actions/getters
- 2Stores can't depend on each other
- 3Use
provide/injectbetween stores
Explanation
const user = useUserStore() inside a store works. Avoid two setup stores that read each other's state immediately during setup - that creates an initialization cycle.