Closed laurensdijkstra closed 9 years ago
No, you have to use observeAll for that scenario.
For observe(data, path, callback) path can include a wild card, , but only as a leaf property - "a.b.", for example, (where a.b is an object, not an array) - to listen to any property change on the object a.b.
"a.b.*.foo" is not supported (neither when a.b. is an object nor when it is an array).
Even after V1.1 this is unlikely to be supported, since the observeAll API is available, and the code to support "a.*.b" would be complex.
Yes I can imagine that the fact that JS has no type-safety makes Arrays of Objects very unpredictable and would need alot of checks to determine whether an object somewhere at the requested depth in the path contains the requested property.
Thanks for the quick reply.
Hi BorisMoore,
I'm investigating the capabilties of your library and it seems what I'm trying to achieve is not possible at this moment. I have a two dimensional array of objects within a project:
What I would like is to listen to changes on propertyOfInterest within the objects in the instances objects. I have tried:
and a few different punctuations to no avail.
Is it not supported to directly listen to a specific property within a multidimensional array?
P.S. I know I could achieve the same functionality by using observeAll and checking the path for the propertyOfInterest.