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

computedFrom using Set doesn't watch for changes to Set #383

Closed
cehoffman opened this issue Apr 21, 2016 · 3 comments
Closed

computedFrom using Set doesn't watch for changes to Set #383

cehoffman opened this issue Apr 21, 2016 · 3 comments
Labels

Comments

@cehoffman
Copy link

Basic idea is I'm trying to use @computedFrom on a property that contains a set and I expected it would watch that set for changes. But it doesn't. I guess I can understand that the basic implementation is only watching if the value a property is replaced, but it seems a natural extension based on how changes to sets are propagated in the view on repeat.for that this would work. Perhaps the binding could look at the current value and change what is watched if it is a more complex type like Map, Set, and Array?

I have a sample gist showing this.

https://gist.run/?id=16c4ad2dcb10368292ba0dd69dccbcd1

@jdanyow
Copy link
Contributor

jdanyow commented Apr 23, 2016

Would this work for you: https://gist.run/?id=5bdb56a888a2269a9bec7af373655ee6

There's also a gist here that might be helpful: aurelia/templating-binding#86

@kellyethridge
Copy link

@jdanyow Your solution works in Chrome but not in Firefox. The state argument is always undefined. Is that expected?

@cehoffman
Copy link
Author

@jdanyow yeah that does work. Thanks for looking at the problem from a different angle.

@jdanyow jdanyow closed this as completed Apr 26, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants