Subscribe on changes!

[Reactivity API] Not possible to reflect original object's changes.

avatar
Feb 14th 2022

Version

3.2.31

Reproduction link

https://codesandbox.io/s/vue3-bi-direction-f0tsh?file=/src/App.vue

Steps to reproduce

  1. open the Reproduction link
  2. wait for 1s
  3. confirm that the text 'initial text' keep as it, where it really should be changed to 'NEW TEXT'

What is actually happening?

I made a workaround for this, just comment out the bindToProxy(foo);, and run it again. I think this behavior should be included into the core by default, or at least by an option of ref or reactive. Or, maybe vue could check if the target object has a specific symbol so it can determine if use this "bi-directional" strategy.

avatar
Feb 14th 2022

our opinion is that it's a bad idea to use complex, stateful classes that have their own side-effects in combination with reactivity.

We won't add such a helper to the core for that reason.