Vue 3 Reactivity Explained: A Deep Dive into the "ref" Function
Welcome to our journey into the world of Vue 3's reactivity system! If you've been following along, you already know that we've been piecing together some vital components in the previous articles.
In the first part of this series, we crafted the tri...
nasserspace.hashnode.dev8 min read
Egor V
vue, nuxt, javascript, css, html, frontend, node
In this implementation if we try to create a ref with an object as a value (e.g. const test = ref({ count: 2 })) and then, if we change the value (e.g. test.value.count = 4) the setter (and accordingly the effect) WON'T BE triggered. I guess it's ok, because the setter tracks only the value changes but we try to change a property of the value. The intresting thing is it works in a different way in Vue and the setter WILL BE triggered in this case. It would be nice to know why and how they implemented it.