refactor(connectTo): Call the change handler after value is set#82
refactor(connectTo): Call the change handler after value is set#82jmzagorski wants to merge 1 commit intoaurelia:masterfrom jmzagorski:call-changehandler-after-value-set
Conversation
Change this logic to align with Aurelia's change handling method invocation for view model properties. @bindable and @observable both call the property change method after the value is set. closes #69 BREAKING CHANGE: the property value being changed will be set and equal to the newVal parameter when its change handler is invoked. To migrate from old code, get the old value from the oldValue parameter in the method call instead of getting a value from the view model property
|
Thanks thats great. The problem is still the breaking behavior, so I guess we need to update the docs as well. I'll check this tomorrow and will merge this |
|
To be honest, I only did this since I called myself out in #69 to fix this and did not want to keep anyone waiting. However, after I finished and wrote the commit message with the breaking change I doubted a merge since it may bump a major version. Maybe this should wait until a v2.0? It really is not a huge change as you can see. We could handle #69 in another way since that issue brought up property decorators. I started using typescript and ditched the |
|
Exactly what I thought. Had a local branch with the same changes and was holding off a bit due to the breaking change. Sooner or later we'll definitely have this merged as V2. I'd be interested to see what you did with the select and action decorators. Tbvh I pretty much never use connectTo either since I prefer to have full subscription control, so I'm open for any ideas here. Maybe post in the mentioned issue or create a new one as suggestion |
Change this logic to align with Aurelia's change handling method invocation for
view model properties. @bindable and @observable both call the property
change method after the value is set. This change simply flips the order they are called
in the decorator
closes #69
BREAKING CHANGE: the property value being changed will be set and equal to the
newValparameter when its change handler is invoked. To migrate from oldcode, get the old value from the
oldValueparameter in the method callinstead of getting a value from the view model property