isObservableLike
Test if a value (or its keys) can be observed for changes.
isObservableLike(obj)
Return true
if obj
is not a primitive and implements any of
@@can.onValue
, @@can.onKeyValue
, or
@@can.onKeys
; false
otherwise.
canReflect.isObservableLike(null); // -> false
canReflect.isObservableLike({}); // -> false
canReflect.isObservableLike([]); // -> false
canReflect.isObservableLike(function() {}); // -> false
canReflect.isObservableLike({ [canSymbol.for("can.onValue")]: function() {} }); // -> true
canReflect.isObservableLike({ [canSymbol.for("can.onKeyValue")]: function() {} }); // -> true
canReflect.isObservableLike(canCompute())); // -> true
canReflect.isObservableLike(new DefineMap())); // -> true
Parameters
- obj
{*}
:maybe an observable
Returns
{Boolean}
: