Skip to content

Why do I need to specify deep: true in Vue watcher inside Pinia store? #2532

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

You must be logged in to vote

It should be an umbrella term. I recommend you to try out a bit with the playground to get a better understanding of the watchers + deep. I personally don't find it that intuitive but it makes sense for performance not to trigger deeply on refs as their value can change. In reactive objects, the value can't change, only nested properties can change, so the watcher has to be deep or it will never trigger.

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@nvmnghia
Comment options

@posva
Comment options

Answer selected by posva
@nvmnghia
Comment options

@posva
Comment options

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