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 CIDMap that
maps each Map-like object providing keyed values to an Array of the relevant keys; valueDependencies
is a
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="Provides a mechanism to notify when an observable has been read and a
way to observe those reads called within a given function.">can-observation</a>
Parameters
- obj
{Object}
:the object to check for value dependencies
Returns
{Object}
:
the observable objects that obj
's value depends on