valueHasDependencies
Determine whether the value of an observable object is bound to other events
valueHasDependencies(obj)
Returns true
if the computed value of the Value-like object obj
derives from other values.
Returns false
if obj
is computed but does not have dependencies on other objects. If obj
is not
a computed value, returns undefined
.
obj
must implement @@can.valueHasDependencies to work with
canReflect.valueHasDependencies
.
var foo = canCompute( "bar" );
var baz = canCompute(function() {
return foo();
});
var quux = "thud";
var jeek = canCompute(function(plonk) {
if(argument.length) {
quux = plonk;
}
return quux;
});
canReflect.valueHasDependencies(baz); // -> true
canReflect.valueHasDependencies(jeek); // -> false
canReflect.valueHasDependencies(foo); // -> undefined
Parameters
- obj
{Object}
:the object to check for dependencies
Returns
{Boolean}
:
true
if there are other dependencies that may update the object's value; false
otherwise