vue-class-store
vue-class-store copied to clipboard
Preserving `this` identity (Vue 3) + tweaks
This implements #29, #30, and #31. I'll update this branch as those issues are discussed
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.
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.
Updating the docs has taken a bit longer than expected, so this branch should be ready tomorrow
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.
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