keyHasDependencies
Determine whether the value for a named property on an object is bound to other events
keyHasDependencies(obj, key)
Returns true if the computed value of the property key on Map-like object obj derives from other values.
Returns false if key is computed on obj but does not have dependencies on other objects. If key is not
a computed value on obj, returns undefined.
obj must implement @@can.keyHasDependencies to work with
canReflect.keyHasDependencies.
var foo = new DefineMap({ "bar": "baz" })
var obj = new (DefineMap.extend({
baz: {
get: function() {
return foo.bar;
}
},
quux: {
get: function() {
return "thud";
}
}
}))();
canReflect.keyHasDependencies(obj, "baz"); // -> true
canReflect.keyHasDependencies(obj, "quux"); // -> false
canReflect.keyHasDependencies(foo, "bar"); // -> undefined
Parameters
- obj
{Object}:the object to check for key dependencies
- key
{String}:the key on the object to check
Returns
{Boolean}:
true if there are other objects that may update the keyed value; false otherwise