getValueDependencies
Return all the events that bind to the value of an observable, Value-like object
getValueDependencies(obj)
Return the observable objects that provide input values to generate the computed value of the
Value-like object obj
. If obj
does not have dependencies, returns undefined
.
Otherwise returns an object with up to two keys: keyDependencies
is a [can-util/js/cid-map/cid-map CIDMap] that
maps each Map-like object providing keyed values to an Array of the relevant keys; valueDependencies
is a
[can-util/js/cid-set/cid-set CIDSet] that contains all Value-like dependencies providing their own values.
obj
must implement @@can.getValueDependencies to work with
canReflect.getValueDependencies
.
var foo = new DefineMap({ "bar": "baz" })
var obj = canCompute(function() {
return foo.bar;
});
canReflect.getValueDependencies(obj); // -> { valueDependencies: CIDSet } because `obj` is internally backed by
a <a href="../can-observation.html" title="Create observable values that derive their value from other observable
values.">can-observation</a>
Parameters
- obj
{Object}
:the object to check for value dependencies
Returns
{Object}
:
the observable objects that obj
's value depends on