vue-class-store icon indicating copy to clipboard operation
vue-class-store copied to clipboard

Preserving `this` identity (Vue 3) + tweaks

Open thecodewarrior opened this issue 2 years ago • 5 comments

This implements #29, #30, and #31. I'll update this branch as those issues are discussed

thecodewarrior avatar Nov 05 '21 23:11 thecodewarrior

BTW - sorry to let this go off the boil. Work has been particularly intense this last 6 weeks. I'm hoping to get some time on OSS again this week.

davestewart avatar Nov 28 '21 21:11 davestewart

No worries! It hasn't been blocking so far, the work on our project is still isolated to one experimental branch, so yarn link has been working fine.

thecodewarrior avatar Dec 01 '21 17:12 thecodewarrior

Updating the docs has taken a bit longer than expected, so this branch should be ready tomorrow

thecodewarrior avatar May 16 '23 22:05 thecodewarrior

So I think I can make VueStore in vue 3 work

  • with any class hierarchy
  • with full inheritance (e.g. any class extending a VueStore class is fully reactive)
  • with no extra prototype shenanigans

The one concession it requires is that it doesn't support "dynamic" watches or computed properties, because it the vue store will be injected "at some point" in he hierarchy, it'll only be able to (reliably) scan the prototype, not any values added at runtime.

thecodewarrior avatar May 18 '23 18:05 thecodewarrior

So doing it that way would be a breaking change, however I can make it fall back to the old behavior when used as a decorator, then discourage using that method in the documentation

thecodewarrior avatar May 26 '23 20:05 thecodewarrior