-
-
Notifications
You must be signed in to change notification settings - Fork 102
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
Enhance the @bindable decorator with a <propertyName>Set handler #551
Comments
@EisenbergEffect Is this desired? If yes how does this behavior play together with type coercion? I could put down some base gist if you could give some direction. |
Let's hold off for now.
…Sent from my iPhone
On Aug 8, 2017, at 11:50 PM, bigopon ***@***.***> wrote:
@EisenbergEffect Is this desired? If yes how does this behavior play together with type coercion? I could put down some base gist if you could give some direction.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
@EisenbergEffect keep in mind? won't happen? |
It might be better to investigate supporting existing getter/setter rather than more callbacks for vNext. I'd need to investigate how that might work. Maybe something like this psuedo code generated by the framework:
For this to work, there can't really be any other state that affects the values.... |
Thought about proxies? |
reminds me of this one |
Can't use proxies for this because a proxy can't change the existing instance. It can only wrap an instance and then all activity has to go through the proxy. If anything has access to the original object, all observation would break. |
The logic that applies the proxy could also peel the |
The issue is that you would have to strictly control creation and referencing of all objects to make a proxy-based system work. Also, proxies are much slower. |
I'm submitting a feature request
1.4.1 (aurelia-templating)
Please tell us about your environment:
Operating System:
OSX 10.11.6
Node Version:
6.10.0
4.3.0
JSPM 0.16.53
Browser:
all
Language:
ESNext
Current behavior:
@bindable
supports<propertyName>Changed
event handlers. So, if one has a bindable property in a custom element namedvalue
, and if a method on the custom element's class calledvalueChanged
is present, it will fire. This is great!Expected/desired behavior:
It would be nice if
@bindable
supported<propertyName>Set
event handlers. So, if one has a bindable property namedvalue
, and if a method on the custom element's class calledvalueSet
is present, it will fire, anytime there's an attempt to set the value and regardless of whether the new value is the same as, or different from, the old value.Sometimes the very act of setting a value on a bindable is meaningful in itself. Both setting and changing can have independent significance.
The text was updated successfully, but these errors were encountered: