-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Computed binding not executed if argument is undefined #2158
Comments
Hi, @MaKleSoft -- I noticed this previously, as well. As it turns out, what you're seeing is by design. See kevin's helpful response here: |
Thanks, @robrez, that clears things up somewhat. Doesn't explain the inconsistent behavior though. |
These behaviors are by design. I grant that when compared side-by-side it may be counter-intuitive, but there are actually just two rules that govern the current behavior:
Thus from your examples above:
That said, we have been exploring refinements to these rules based on feedback. Possibilites include:
|
As a result of this you cannot have a simple computed |
@kaste or @kevinpschaaf, what's a workaround for |
Almost an year and a half since this issue was posted and this still hasn't been solved? I found myself in a position where I need a very simple As @kevinpschaaf explained:
What if both dependent properties have declared values to be used as default value? Why do they still need to be "set" to be considered resolved? I'm pretty sure it can all go down to a simple check. Does the property have declared value? (yes) ==> Push effects once at the beginning. This way you even won't have to break your "don't set As an example for my case in particular, I need to display a bar holding a (String) I've declared both properties to a |
+1 |
1 similar comment
+1 |
Observers run with |
I've noticed two scenarios in which computed bindings where not executed.
Binding to an undefined property:
For this is does not matter if
blah
is a declared property or not.Binding to an undefined subproperty if the compute function has more than one argument:
Strangely enough, binding to an undefined property works if it is the only argument:
The text was updated successfully, but these errors were encountered: