Watching a shallowRef array that is inside a store, from a Vue component #2964
-
ReproductionSteps to reproduce the bug
Expected behaviorI would expect to be able to watch when a shallowRef array inside a store is being updated, but that does not seem to be the case. Is this a limitation of shallowRef or Pinia, or am I doing something wrong? Actual behaviorwatchers should be triggered by shallowRefs just like any other ref value. Additional informationIn the reproduction I use console.log to check if the watchers are working, and you can see the logs directly from the browser's developer tools. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
You need |
Beta Was this translation helpful? Give feedback.
-
@posva Thank you! Is this going to "unshallow" my array, or will it stay reactive only on the array reference level? |
Beta Was this translation helpful? Give feedback.
You need
deep: true
outside of the store