I have a store pattern that contains reactive objects outside of the components that use them (I call it a store because of this page https://v3.vuejs.org/guide/state-management.html#simple-state-management-from-scratch)
So, a reactive object is shared across an unknown number of components that may or may not be currently rendering content on the page.
But I have some synchronization logic that is expensive, so I only want it to run for objects in my store that are being used.
In Vue2, I found an undocumented way to do this.
reactiveObject.__ob__.dep.subs.length
The Subcribers are visible, and if a component is no longer rendered (is not the current route in vue-router for example) then Vue2 did a perfect job of unsubcribing when removing that component from the DOM.
I'm upgrading to Vue3, and as far as I can tell, it called "Tracked" instead of "Subscribed" but this tracking information seems to be in a private scope (might be the targetMap variable that Vue3's source code uses during track() and trigger()).
Is there a way to know if a Vue3 reactive object is currently being watched? To know if a change to that object will trigger anything?