Watches a property for changes on each item in a collection like object. This
can be a property on an item in a collection, an item in a collection in the
given object or an item in a collection in a nested observable object.
This function will return a handle that can be used to stop watching the
property.
If the collection contains multiple different types of objects, only objects
that have the property being watched will be watched for changes, the other
objects will be ignored.
The callback will be invoked with the new value, old value, and the target
object when the property changes. The target object will be the object in the
collection that changed. The callback will be invoked for each item in the
collection when the property on the object changes. The callback will not be
invoked when items are added or removed from the collection unless the
options include initial: true in which case the callback will be invoked
for each item in the collection when the watch is created as well as for any
items that are added to the collection after.
The callback will not be invoked if the value has not changed. This includes
if a parent property changes but the resulting value is the same as the
previous value.
If any property in the path after the path to the collection can be
undefined, the callback will be invoked with an undefined newValue and an
undefined target when a parent property changes to undefined.
If any property throws an exception during watch setup, the first callback
invocation will be invoked with oldValue and newValue having the same value.
Watches a property for changes on each item in a collection like object. This can be a property on an item in a collection, an item in a collection in the given object or an item in a collection in a nested observable object.
This function will return a handle that can be used to stop watching the property.
If the collection contains multiple different types of objects, only objects that have the property being watched will be watched for changes, the other objects will be ignored.
The callback will be invoked with the new value, old value, and the target object when the property changes. The target object will be the object in the collection that changed. The callback will be invoked for each item in the collection when the property on the object changes. The callback will not be invoked when items are added or removed from the collection unless the options include
initial: truein which case the callback will be invoked for each item in the collection when the watch is created as well as for any items that are added to the collection after.The callback will not be invoked if the value has not changed. This includes if a parent property changes but the resulting value is the same as the previous value.
If any property in the path after the path to the collection can be undefined, the callback will be invoked with an undefined newValue and an undefined target when a parent property changes to undefined.
If any property throws an exception during watch setup, the first callback invocation will be invoked with oldValue and newValue having the same value.