Vue · Middle · Question 44 of 75

How can one Pinia store use another?

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.

Further reading

Problem with a question

Vue · Middle · question 44

Test yourself

Take the Vue · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz