Description
What problem does this feature solve?
This is for users who are implementing bridges between the reactivity of VueJS and external systems which manage their own data internally and which have their own reactivity system.
Giving a way to users to access Dep
will allow them to define a dependency in a simple way. The use case is for defining changing values from other systems (mini-mongo's reactive queries, for instance) as dependencies in watched functions.
Currently, the users can only use defineReactive()
, which means that there should be an object and a field for the dependency to exist. It is quite painful since the only thing needed is a const dep = new Dep()
on which we would call depend()
each time the external resource (function, db cursor, etc ...) changed.
What does the proposed API look like?
I propose to expose Dep
in the object Vue.util
.