Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

observeAll doesn't trigger events on some array changes view setProperty. #252

Closed
virajsanghvi opened this issue Apr 9, 2014 · 3 comments

Comments

@virajsanghvi
Copy link

This isn't a huge deal to me as this isn't normal usage, but this surfaced as I was writing tests around some logic that I use to wrap jsviews.

If you take a look at http://jsfiddle.net/sAzVU/1/, you'll see that updating the element of a list via setProperty and a path like 'list.0', observeAll() doesn't trigger an event. Oddly, setting something in an object within an array, i.e. 'list.0.subattr', does trigger an event.

Anyways, not sure how much you were expecting to support something like this, but thought I'd point it out.

@BorisMoore
Copy link
Owner

Thanks Viraj. In general observable changes to arrays have to go through the array APIs, not setProperty. Using setProperty with paths like "myArray.2" is adding a key value pair to myArray treated as an object (hash/dictionary) with key "2". But I appreciate your bringing up the question. I'll try to check on the actual behavior and see if it is acceptable - or whether the support can/should be improved. And also it would be good if I can add some unit tests with scenarios of this kind.

@BorisMoore
Copy link
Owner

Consider whether this scenario needs to be supported, but only after V1.0 - or V1.1. - otherwise, close as unsupported...

@BorisMoore
Copy link
Owner

Closing "After V1.0" issues for now - to reopen as appropriate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants